pub struct CloudItem { /* private fields */ }Expand description
Stable item identity plus its current parent, name, kind, and revisions.
Implementations§
Source§impl CloudItem
impl CloudItem
Sourcepub fn directory(
key: CloudItemKey,
parent_id: Option<CloudItemId>,
name: impl Into<String>,
metadata_revision: MetadataRevision,
) -> Result<Self>
pub fn directory( key: CloudItemKey, parent_id: Option<CloudItemId>, name: impl Into<String>, metadata_revision: MetadataRevision, ) -> Result<Self>
Creates a directory. parent_id = None identifies the root item for the scope.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn file(
key: CloudItemKey,
parent_id: CloudItemId,
name: impl Into<String>,
metadata_revision: MetadataRevision,
content: CloudContentMetadata,
) -> Result<Self>
pub fn file( key: CloudItemKey, parent_id: CloudItemId, name: impl Into<String>, metadata_revision: MetadataRevision, content: CloudContentMetadata, ) -> Result<Self>
Creates a regular file. Files always require a parent within the same scope.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn key(&self) -> &CloudItemKey
pub const fn key(&self) -> &CloudItemKey
Returns the fully scoped stable identity.
Sourcepub const fn parent_id(&self) -> Option<&CloudItemId>
pub const fn parent_id(&self) -> Option<&CloudItemId>
Returns the parent item identity, or None for the root item.
Sourcepub const fn kind(&self) -> CloudItemKind
pub const fn kind(&self) -> CloudItemKind
Returns the current item kind.
Sourcepub const fn metadata_revision(&self) -> &MetadataRevision
pub const fn metadata_revision(&self) -> &MetadataRevision
Returns the opaque metadata revision.
Sourcepub const fn content(&self) -> Option<&CloudContentMetadata>
pub const fn content(&self) -> Option<&CloudContentMetadata>
Returns file content metadata, or None for a directory.
Sourcepub const fn is_root(&self) -> bool
pub const fn is_root(&self) -> bool
Returns whether this item is the root directory of its scope.
Sourcepub fn moved(
self,
parent_id: CloudItemId,
name: impl Into<String>,
metadata_revision: MetadataRevision,
) -> Result<Self>
pub fn moved( self, parent_id: CloudItemId, name: impl Into<String>, metadata_revision: MetadataRevision, ) -> Result<Self>
Applies a same-root rename or move while preserving the stable item key and content state.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.