Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/python/templates/BooleanHelper.py

raw
1 class _UniffiConverterBool:
2 @classmethod
3 def check_lower(cls, value):
4 return not not value
5
6 @classmethod
7 def lower(cls, value):
8 return 1 if value else 0
9
10 @staticmethod
11 def lift(value):
12 return value != 0
13
14 @classmethod
15 def read(cls, buf):
16 return cls.lift(buf.read_u8())
17
18 @classmethod
19 def write(cls, value, buf):
20 buf.write_u8(value)