pub struct SyncwebFolder { /* private fields */ }Implementations§
Source§impl SyncwebFolder
impl SyncwebFolder
pub fn new( doc: Doc, author: AuthorId, blob_store: BlobStore, docs_engine: DocsEngine, sync_mode: SyncMode, ) -> Self
Sourcepub async fn drop_namespace(&self) -> Result<()>
pub async fn drop_namespace(&self) -> Result<()>
Drop this folder’s namespace from the docs engine.
§Errors
Returns an error if the namespace cannot be dropped.
pub const fn namespace_id(&self) -> NamespaceId
pub const fn mode(&self) -> SyncMode
pub const fn doc(&self) -> &Doc
pub const fn docs_engine(&self) -> &DocsEngine
pub async fn grant(&self, node_id: PublicKey, capability: Capability)
pub async fn capability(&self, node_id: PublicKey) -> Option<Capability>
pub async fn can_write_as(&self, node_id: PublicKey) -> bool
Sourcepub async fn has_local(&self, hash: Hash) -> Result<bool>
pub async fn has_local(&self, hash: Hash) -> Result<bool>
Check whether a blob is complete in this folder’s local store.
§Errors
Returns an error if the blob store cannot be queried.
Sourcepub async fn content_entries(&self) -> Result<Vec<Entry>>
pub async fn content_entries(&self) -> Result<Vec<Entry>>
List the folder’s content entries, excluding sys/ metadata keys.
Used by stats, verify, and health-reporting paths so the “iterate the latest per-key entries, skip system keys” pattern lives in one place.
§Errors
Returns an error if the document query fails.
Sourcepub async fn set_blob(
&self,
key: impl AsRef<[u8]>,
value: impl AsRef<[u8]>,
) -> Result<Hash>
pub async fn set_blob( &self, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>, ) -> Result<Hash>
§Errors
Returns an error if the blob fails to be stored or set.
Sourcepub async fn set_blob_ref(
&self,
key: impl AsRef<[u8]>,
hash: Hash,
size: u64,
) -> Result<()>
pub async fn set_blob_ref( &self, key: impl AsRef<[u8]>, hash: Hash, size: u64, ) -> Result<()>
Store an existing blob reference in this folder.
§Errors
Returns an error if the folder is read-only, the blob is unavailable, or the document entry cannot be written.
Sourcepub async fn delete_entry(&self, key: impl AsRef<[u8]>) -> Result<()>
pub async fn delete_entry(&self, key: impl AsRef<[u8]>) -> Result<()>
Delete a folder entry.
§Errors
Returns an error if the folder is read-only or the document entry cannot be deleted.
Sourcepub async fn ticket(&self, writable: bool) -> Result<DocTicket>
pub async fn ticket(&self, writable: bool) -> Result<DocTicket>
§Errors
Returns an error if the folder ticket cannot be created.
Sourcepub async fn publish_blob(
&self,
endpoint: EndpointAddr,
hash: Hash,
) -> Result<BlobTicket>
pub async fn publish_blob( &self, endpoint: EndpointAddr, hash: Hash, ) -> Result<BlobTicket>
Create an unauthenticated ticket for a blob in this folder and pin it while it is publicly shared.
§Errors
Returns an error if the blob is unavailable or cannot be pinned.
Sourcepub async fn unpublish_blob(&self, hash: Hash) -> Result<()>
pub async fn unpublish_blob(&self, hash: Hash) -> Result<()>
Remove the public-sharing pin from a folder blob.
Existing blob tickets are capabilities and remain usable while another tag or active transfer retains the blob.
§Errors
Returns an error if the public-sharing pin cannot be removed.
Sourcepub async fn pin_all_content(&self) -> Result<usize>
pub async fn pin_all_content(&self) -> Result<usize>
Pin every blob currently referenced by the folder’s document so the shared content is retained (not evicted by garbage collection).
Returns the number of distinct blobs pinned.
§Errors
Returns an error if the folder’s entries cannot be read or a pin fails.
Sourcepub async fn unpin_all_content(&self) -> Result<usize>
pub async fn unpin_all_content(&self) -> Result<usize>
Remove the retention pins placed by pin_all_content
for every blob currently referenced by the folder’s document.
Returns the number of pins removed.
§Errors
Returns an error if the folder’s entries cannot be read or an unpin fails.
Trait Implementations§
Source§impl Clone for SyncwebFolder
impl Clone for SyncwebFolder
Source§fn clone(&self) -> SyncwebFolder
fn clone(&self) -> SyncwebFolder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl FolderLike for SyncwebFolder
impl FolderLike for SyncwebFolder
fn namespace_id(&self) -> String
fn label(&self) -> String
fn kind(&self) -> &'static str
fn path(&self) -> Option<&Path>
fn list_entries<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<EntryLike>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SyncwebFolder
impl !UnwindSafe for SyncwebFolder
impl Freeze for SyncwebFolder
impl Send for SyncwebFolder
impl Sync for SyncwebFolder
impl Unpin for SyncwebFolder
impl UnsafeUnpin for SyncwebFolder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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