MCPcopy Create free account
hub / github.com/dfinity/orbit / to_bytes

Method to_bytes

core/station/impl/src/models/system.rs:256–261  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

254/// Adds serialization and deserialization support of SystemState to stable memory.
255impl Storable for SystemState {
256 fn to_bytes(&self) -> Cow<[u8]> {
257 match &self {
258 SystemState::Uninitialized => Cow::Borrowed(&[]),
259 SystemState::Initialized(info) => info.to_bytes(),
260 }
261 }
262
263 fn from_bytes(bytes: Cow<[u8]>) -> Self {
264 if bytes.is_empty() {

Calls

no outgoing calls