Struct cloud_filter::placeholder_file::PlaceholderFile
source · pub struct PlaceholderFile(/* private fields */);
Expand description
A builder for creating new placeholder files/directories.
Implementations§
source§impl PlaceholderFile
impl PlaceholderFile
sourcepub fn new(relative_path: impl AsRef<Path>) -> Self
pub fn new(relative_path: impl AsRef<Path>) -> Self
Creates a new [PlaceholderFile][crate::PlaceholderFile].
sourcepub fn has_no_children(self) -> Self
pub fn has_no_children(self) -> Self
Marks this [PlaceholderFile][crate::PlaceholderFile] as having no child placeholders on creation.
If [PopulationType::Full][crate::PopulationType] is specified on registration, this flag will prevent [SyncFilter::fetch_placeholders][crate::SyncFilter::fetch_placeholders] from being called for this placeholder.
Only applicable to placeholder directories.
sourcepub fn mark_in_sync(self) -> Self
pub fn mark_in_sync(self) -> Self
Marks a placeholder as in sync.
See also SetInSyncState, What does “In-Sync” Mean?
sourcepub fn block_dehydration(self) -> Self
pub fn block_dehydration(self) -> Self
Blocks this placeholder file from being dehydrated.
This flag does not work on directories.
sourcepub fn metadata(self, metadata: Metadata) -> Self
pub fn metadata(self, metadata: Metadata) -> Self
The metadata for the [PlaceholderFile][crate::PlaceholderFile].
sourcepub fn blob(self, blob: Vec<u8>) -> Self
pub fn blob(self, blob: Vec<u8>) -> Self
A buffer of bytes stored with the file that could be accessed through a [Request::file_blob][crate::Request::file_blob] or [FileExit::placeholder_info][crate::ext::FileExt::placeholder_info].
The buffer must not exceed 4KiB.
pub fn result(&self) -> Result<Usn>
sourcepub fn create<P: AsRef<Path>>(self, parent: impl AsRef<Path>) -> Result<Usn>
pub fn create<P: AsRef<Path>>(self, parent: impl AsRef<Path>) -> Result<Usn>
Creates a placeholder file/directory on the file system.
The value returned is the final [Usn][crate::Usn] after the placeholder is created.
It is recommended to use this function over [FileExt::to_placeholder][crate::ext::FileExt::to_placeholder] for efficiency purposes. If you need to create multiple placeholders, consider using [BatchCreate][crate::BatchCreate].
If you need to create placeholders from the [SyncFilter::fetch_placeholders][crate::SyncFilter::fetch_placeholders] callback, do not use this method. Instead, use [FetchPlaceholders::pass_with_placeholders][crate::ticket::FetchPlaceholders::pass_with_placeholders].