pub struct FolderManager { /* private fields */ }Implementations§
Source§impl FolderManager
impl FolderManager
pub fn new(node: &IrohNode) -> Self
Sourcepub async fn create(&self, mode: SyncMode) -> Result<SyncwebFolder>
pub async fn create(&self, mode: SyncMode) -> Result<SyncwebFolder>
§Errors
Returns an error if the folder namespace cannot be created or initialized.
Sourcepub async fn join(
&self,
ticket_str: impl AsRef<str>,
mode: SyncMode,
) -> Result<SyncwebFolder>
pub async fn join( &self, ticket_str: impl AsRef<str>, mode: SyncMode, ) -> Result<SyncwebFolder>
§Errors
Returns an error if the folder ticket cannot be joined or parsed.
Sourcepub async fn subscribe_public(&self, ticket: &BlobTicket) -> Result<Hash>
pub async fn subscribe_public(&self, ticket: &BlobTicket) -> Result<Hash>
Subscribe to a public blob ticket. Fetches the blob and returns its hash. Does NOT create an Iroh doc namespace.
§Errors
Returns an error if the blob cannot be fetched.
Sourcepub async fn accept(&self, namespace_id: NamespaceId) -> Result<SyncwebFolder>
pub async fn accept(&self, namespace_id: NamespaceId) -> Result<SyncwebFolder>
§Errors
Returns an error if the folder namespace cannot be accepted.
Sourcepub async fn announce_namespace(&self, namespace_id: NamespaceId)
pub async fn announce_namespace(&self, namespace_id: NamespaceId)
Announce a namespace to the topic tracker if not already announced. Idempotent — safe to call multiple times for the same namespace.
Sourcepub async fn subscriptions(&self) -> Vec<Hash>
pub async fn subscriptions(&self) -> Vec<Hash>
Return all managed public subscription hashes.
Sourcepub async fn seed_subscriptions(&self, hashes: impl IntoIterator<Item = Hash>)
pub async fn seed_subscriptions(&self, hashes: impl IntoIterator<Item = Hash>)
Seed the subscription set from persisted hashes (e.g. loaded from SQLite
on startup).
Sourcepub async fn drop_subscription(&self, hash: &Hash)
pub async fn drop_subscription(&self, hash: &Hash)
Drop (unsubscribe from) a public blob subscription.
Sourcepub async fn has_subscription(&self, hash: &Hash) -> bool
pub async fn has_subscription(&self, hash: &Hash) -> bool
Check whether a public subscription for the given hash exists.
Sourcepub async fn drop(&self, namespace_id: NamespaceId) -> Result<()>
pub async fn drop(&self, namespace_id: NamespaceId) -> Result<()>
§Errors
Returns an error if the folder namespace cannot be dropped.
Sourcepub async fn list(&self) -> Result<Vec<SyncwebFolder>>
pub async fn list(&self) -> Result<Vec<SyncwebFolder>>
§Errors
Returns an error if the folders cannot be listed.
Sourcepub async fn get(&self, namespace_id: NamespaceId) -> Result<SyncwebFolder>
pub async fn get(&self, namespace_id: NamespaceId) -> Result<SyncwebFolder>
Return a managed folder, loading locally available namespaces first.
§Errors
Returns an error if the local namespace list cannot be read.
Trait Implementations§
Source§impl Clone for FolderManager
impl Clone for FolderManager
Source§fn clone(&self) -> FolderManager
fn clone(&self) -> FolderManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FolderManager
impl !UnwindSafe for FolderManager
impl Freeze for FolderManager
impl Send for FolderManager
impl Sync for FolderManager
impl Unpin for FolderManager
impl UnsafeUnpin for FolderManager
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