pub struct RootManifest {
pub root: Option<Cid>,
pub config: Config,
pub created_at_millis: Option<u64>,
pub updated_at_millis: Option<u64>,
}Expand description
Durable named-root payload.
A root manifest stores the complete tree handle needed to reopen a named snapshot. The root CID alone is not enough because chunking and encoding config determine how the tree should be interpreted.
Fields§
§root: Option<Cid>Root node CID, or None for the empty tree.
config: ConfigTree configuration associated with this root.
created_at_millis: Option<u64>Optional Unix timestamp in milliseconds when this named root was created.
updated_at_millis: Option<u64>Optional Unix timestamp in milliseconds when this named root was updated.
Implementations§
Source§impl RootManifest
impl RootManifest
Sourcepub fn new(root: Option<Cid>, config: Config) -> Self
pub fn new(root: Option<Cid>, config: Config) -> Self
Create a new manifest from a root CID and config.
Sourcepub fn with_timestamps_millis(
self,
created_at_millis: Option<u64>,
updated_at_millis: Option<u64>,
) -> Self
pub fn with_timestamps_millis( self, created_at_millis: Option<u64>, updated_at_millis: Option<u64>, ) -> Self
Set optional creation and update timestamps in Unix milliseconds.
Sourcepub fn with_created_at_millis(self, created_at_millis: u64) -> Self
pub fn with_created_at_millis(self, created_at_millis: u64) -> Self
Set the creation timestamp in Unix milliseconds.
Sourcepub fn with_updated_at_millis(self, updated_at_millis: u64) -> Self
pub fn with_updated_at_millis(self, updated_at_millis: u64) -> Self
Set the update timestamp in Unix milliseconds.
Sourcepub fn from_tree_with_timestamps_millis(
tree: &Tree,
created_at_millis: Option<u64>,
updated_at_millis: Option<u64>,
) -> Self
pub fn from_tree_with_timestamps_millis( tree: &Tree, created_at_millis: Option<u64>, updated_at_millis: Option<u64>, ) -> Self
Create a manifest from a tree and timestamp metadata.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, Error>
pub fn to_bytes(&self) -> Result<Vec<u8>, Error>
Serialize this manifest to a versioned, deterministic binary payload.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a manifest from bytes produced by RootManifest::to_bytes.
Trait Implementations§
Source§impl Clone for RootManifest
impl Clone for RootManifest
Source§fn clone(&self) -> RootManifest
fn clone(&self) -> RootManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RootManifest
impl Debug for RootManifest
Source§impl<'de> Deserialize<'de> for RootManifest
impl<'de> Deserialize<'de> for RootManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&Tree> for RootManifest
impl From<&Tree> for RootManifest
Source§impl From<RootManifest> for Tree
impl From<RootManifest> for Tree
Source§fn from(manifest: RootManifest) -> Self
fn from(manifest: RootManifest) -> Self
Source§impl From<Tree> for RootManifest
impl From<Tree> for RootManifest
Source§impl PartialEq for RootManifest
impl PartialEq for RootManifest
Source§impl Serialize for RootManifest
impl Serialize for RootManifest
impl StructuralPartialEq for RootManifest
Auto Trait Implementations§
impl Freeze for RootManifest
impl RefUnwindSafe for RootManifest
impl Send for RootManifest
impl Sync for RootManifest
impl Unpin for RootManifest
impl UnsafeUnpin for RootManifest
impl UnwindSafe for RootManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more