pub struct AsyncStorage<B: Backend, S> { /* private fields */ }
Implementations§
Source§impl<B: Backend, S> AsyncStorage<B, S>
impl<B: Backend, S> AsyncStorage<B, S>
pub async fn new( config: AsyncStorageInitConfig<B>, ) -> (AsyncStorage<B, S>, AsyncStorageLoop<B, StdIO, S>)
pub async fn new_with_io<IO>( config: AsyncStorageInitConfig<B>, io: Arc<IO>, ) -> (AsyncStorage<B, S>, AsyncStorageLoop<B, IO, S>)
pub fn backend(&self) -> &B
Sourcepub fn send_shutdown(self) -> impl FnOnce()
pub fn send_shutdown(self) -> impl FnOnce()
send shutdown signal to bottomless. return a function that can be called to force shutdown, if necessary
Trait Implementations§
Source§impl<B, S> Storage for AsyncStorage<B, S>
impl<B, S> Storage for AsyncStorage<B, S>
type Segment = S
type Config = <B as Backend>::Config
async fn shutdown(&self)
Source§fn store(
&self,
namespace: &NamespaceName,
segment: Self::Segment,
config_override: Option<Self::Config>,
on_store_callback: OnStoreCallback,
)
fn store( &self, namespace: &NamespaceName, segment: Self::Segment, config_override: Option<Self::Config>, on_store_callback: OnStoreCallback, )
store the passed segment for
namespace
. This function is called in a context where
blocking is acceptable.
returns a future that resolves when the segment is stored
The segment should be stored whether or not the future is polled.async fn durable_frame_no( &self, namespace: &NamespaceName, config_override: Option<Self::Config>, ) -> Result<u64>
async fn restore( &self, file: impl FileExt, namespace: &NamespaceName, restore_options: RestoreOptions, config_override: Option<Self::Config>, ) -> Result<()>
async fn find_segment( &self, namespace: &NamespaceName, req: FindSegmentReq, config_override: Option<Self::Config>, ) -> Result<SegmentKey>
async fn fetch_segment_index( &self, namespace: &NamespaceName, key: &SegmentKey, config_override: Option<Self::Config>, ) -> Result<Map<Arc<[u8]>>>
async fn fetch_segment_data( &self, namespace: &NamespaceName, key: &SegmentKey, config_override: Option<Self::Config>, ) -> Result<CompactedSegment<impl FileExt>>
fn list_segments<'a>( &'a self, namespace: &'a NamespaceName, until: u64, config_override: Option<Self::Config>, ) -> impl Stream<Item = Result<SegmentInfo>> + 'a
Auto Trait Implementations§
impl<B, S> Freeze for AsyncStorage<B, S>
impl<B, S> !RefUnwindSafe for AsyncStorage<B, S>
impl<B, S> Send for AsyncStorage<B, S>where
S: Send,
impl<B, S> Sync for AsyncStorage<B, S>where
S: Send,
impl<B, S> Unpin for AsyncStorage<B, S>
impl<B, S> !UnwindSafe for AsyncStorage<B, S>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.