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.
sourcepub fn has_no_children(self) -> Self
pub fn has_no_children(self) -> Self
Marks this PlaceholderFile as having no child placeholders on creation.
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.
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 or 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 after the placeholder is created.
It is recommended to use this function over Placeholder for efficiency purposes. If you need to create multiple placeholders, consider using BatchCreate::create.
If you need to create placeholders from the SyncFilter::fetch_placeholders callback, do not use this method. Instead, use FetchPlaceholders::pass_with_placeholder.