Selfie
Loading...
Searching...
No Matches
selfie_lib.SnapshotValue.SnapshotValue Class Reference
Inheritance diagram for selfie_lib.SnapshotValue.SnapshotValue:
selfie_lib.SnapshotValue.SnapshotValueBinary selfie_lib.SnapshotValue.SnapshotValueString

Public Member Functions

bool is_binary (self)
 
bytes value_binary (self)
 
str value_string (self)
 

Static Public Member Functions

"SnapshotValue" of (Union[bytes, str, "SnapshotValue"] data)
 

Detailed Description

Definition at line 7 of file SnapshotValue.py.

Member Function Documentation

◆ is_binary()

bool selfie_lib.SnapshotValue.SnapshotValue.is_binary (   self)

Definition at line 9 of file SnapshotValue.py.

9 def is_binary(self) -> bool:
10 return isinstance(self, SnapshotValueBinary)
11

◆ of()

"SnapshotValue" selfie_lib.SnapshotValue.SnapshotValue.of ( Union[bytes, str, "SnapshotValue"]  data)
static

Definition at line 21 of file SnapshotValue.py.

21 def of(data: Union[bytes, str, "SnapshotValue"]) -> "SnapshotValue":
22 if isinstance(data, bytes):
23 return SnapshotValueBinary(data)
24 elif isinstance(data, str):
25 return SnapshotValueString(_to_unix(data))
26 elif isinstance(data, SnapshotValue):
27 return data
28 else:
29 raise TypeError("Unsupported type for Snapshot creation")
30
31

◆ value_binary()

bytes selfie_lib.SnapshotValue.SnapshotValue.value_binary (   self)

Reimplemented in selfie_lib.SnapshotValue.SnapshotValueBinary, and selfie_lib.SnapshotValue.SnapshotValueString.

Definition at line 13 of file SnapshotValue.py.

13 def value_binary(self) -> bytes:
14 pass
15

◆ value_string()

str selfie_lib.SnapshotValue.SnapshotValue.value_string (   self)

Reimplemented in selfie_lib.SnapshotValue.SnapshotValueBinary, and selfie_lib.SnapshotValue.SnapshotValueString.

Definition at line 17 of file SnapshotValue.py.

17 def value_string(self) -> str:
18 pass
19

The documentation for this class was generated from the following file: