pub struct ScopedStorage<'a> { /* private fields */ }Expand description
The DHT operations of a swarm, scoped by a stop token.
A placement waiting to be rerouted (#859) ends with Error::ReroutingStopped once stop is
requested. Nothing else is interrupted: storage reads and writes, locks, and sends run to
completion, so a caller that owns IndexedDB futures stops cooperatively. Swarm’s own
ChordStorageInterface is this view under a stop that never fires.
Implementations§
Source§impl ScopedStorage<'_>
impl ScopedStorage<'_>
Sourcepub async fn storage_append_data_reported(
&self,
topic: &str,
data: Bytes,
) -> Result<StoreReceipt, Error>
pub async fn storage_append_data_reported( &self, topic: &str, data: Bytes, ) -> Result<StoreReceipt, Error>
ChordStorageInterface::storage_append_data whose owners report it (#866): once it
returns Ok, this node reads its write as ever (read-your-writes), and the receipt
resolves once every remote placement’s owner reported the element stored
(StoreQuorum::Every, message::types::store_report). Unlike the writer’s own read,
the receipt witnesses what the owners hold, and so what another node’s read can reach. A
placement this node owns is stored once the append returns.
Sourcepub async fn storage_extend_reported(
&self,
topic: &str,
data: Vec<Bytes>,
lifetime_ms: u64,
quorum: StoreQuorum,
) -> Result<StoreReceipt, Error>
pub async fn storage_extend_reported( &self, topic: &str, data: Vec<Bytes>, lifetime_ms: u64, quorum: StoreQuorum, ) -> Result<StoreReceipt, Error>
ChordStorageInterface::storage_extend whose owners report it (#866), as
Self::storage_append_data_reported is, its receipt resolving once the reports decide
quorum. Under StoreQuorum::Any, a placement this node owns decides it once the
extend returns.
Trait Implementations§
Source§impl ChordStorageInterface for ScopedStorage<'_>
impl ChordStorageInterface for ScopedStorage<'_>
Source§fn storage_fetch<'life0, 'async_trait>(
&'life0 self,
entry_key: Did,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ScopedStorage<'_>: 'async_trait,
fn storage_fetch<'life0, 'async_trait>(
&'life0 self,
entry_key: Did,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ScopedStorage<'_>: 'async_trait,
Fetch an entry. If it exists in local storage, copy it to the cache; otherwise query the responsible remote node.
Source§fn storage_store<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ScopedStorage<'_>: 'async_trait,
fn storage_store<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ScopedStorage<'_>: 'async_trait,
Store Entry, TryInto<Entry> is implemented for alot of types
Source§fn storage_extend<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Vec<Bytes>,
lifetime_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
fn storage_extend<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Vec<Bytes>,
lifetime_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
The bound and the delta’s version are stamped from one clock reading t.
Source§fn storage_append_data<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
fn storage_append_data<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
data, as its bytes, to a Data kind entry. The element expires as
the trait documentation states unless it is appended again.Source§fn storage_tombstone_data<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
fn storage_tombstone_data<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ScopedStorage<'_>: 'async_trait,
data in a Data kind entry: the removal covers every dot
of data the storage owner holds or has held under a later one.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ScopedStorage<'a>
impl<'a> !UnwindSafe for ScopedStorage<'a>
impl<'a> Forget for ScopedStorage<'a>
impl<'a> Freeze for ScopedStorage<'a>
impl<'a> Move for ScopedStorage<'a>
impl<'a> Send for ScopedStorage<'a>
impl<'a> Sync for ScopedStorage<'a>
impl<'a> Unpin for ScopedStorage<'a>
impl<'a> UnsafeUnpin for ScopedStorage<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.