pub struct Annotated<Tag: Debug + Default + Display + Send + Sync, S: Storage> {
inner: S,
tag: Tag,
}
Expand description
Annotating wrapper around storage objects.
Wraps other storage objects, adding an arbitrary tag to them.
Fields§
§inner: S
Wrapped storage object.
tag: Tag
Tag.
Implementations§
Trait Implementations§
Source§impl<Tag: Debug + Debug + Default + Display + Send + Sync, S: Debug + Storage> Debug for Annotated<Tag, S>
impl<Tag: Debug + Debug + Default + Display + Send + Sync, S: Debug + Storage> Debug for Annotated<Tag, S>
Source§impl<T: Debug + Default + Display + Send + Sync, S: Storage> Storage for Annotated<T, S>
impl<T: Debug + Default + Display + Send + Sync, S: Storage> Storage for Annotated<T, S>
Source§fn open_sync(opts: StorageOpenOptions) -> Result<Self>
fn open_sync(opts: StorageOpenOptions) -> Result<Self>
Synchronous wrapper around
Storage::open()
.Source§async fn create_open(opts: StorageCreateOptions) -> Result<Self>
async fn create_open(opts: StorageCreateOptions) -> Result<Self>
Create a storage object and open it. Read more
Source§fn resolve_relative_path<P: AsRef<Path>>(&self, relative: P) -> Result<PathBuf>
fn resolve_relative_path<P: AsRef<Path>>(&self, relative: P) -> Result<PathBuf>
Resolve the given path relative to this storage object. Read more
Source§async unsafe fn pure_readv(
&self,
bufv: IoVectorMut<'_>,
offset: u64,
) -> Result<()>
async unsafe fn pure_readv( &self, bufv: IoVectorMut<'_>, offset: u64, ) -> Result<()>
Source§async unsafe fn pure_write_zeroes(&self, offset: u64, length: u64) -> Result<()>
async unsafe fn pure_write_zeroes(&self, offset: u64, length: u64) -> Result<()>
Ensure the given range reads back as zeroes. Read more
Source§async unsafe fn pure_discard(&self, offset: u64, length: u64) -> Result<()>
async unsafe fn pure_discard(&self, offset: u64, length: u64) -> Result<()>
Discard the given range, with undefined contents when read back. Read more
Source§async fn sync(&self) -> Result<()>
async fn sync(&self) -> Result<()>
Sync data already written to the storage hardware. Read more
Source§fn get_storage_helper(&self) -> &CommonStorageHelper
fn get_storage_helper(&self) -> &CommonStorageHelper
Return the storage helper object (used by the
StorageExt
implementation).Source§async fn resize(
&self,
new_size: u64,
prealloc_mode: PreallocateMode,
) -> Result<()>
async fn resize( &self, new_size: u64, prealloc_mode: PreallocateMode, ) -> Result<()>
Resize to the given size. Read more
Source§fn zero_align(&self) -> usize
fn zero_align(&self) -> usize
Minimum required alignment for zero writes.
Source§fn discard_align(&self) -> usize
fn discard_align(&self) -> usize
Minimum required alignment for effective discards.
Auto Trait Implementations§
impl<Tag, S> Freeze for Annotated<Tag, S>
impl<Tag, S> RefUnwindSafe for Annotated<Tag, S>where
S: RefUnwindSafe,
Tag: RefUnwindSafe,
impl<Tag, S> Send for Annotated<Tag, S>
impl<Tag, S> Sync for Annotated<Tag, S>
impl<Tag, S> Unpin for Annotated<Tag, S>
impl<Tag, S> UnwindSafe for Annotated<Tag, S>where
S: UnwindSafe,
Tag: UnwindSafe,
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<S> DynStorage for Swhere
S: Storage + 'static,
impl<S> DynStorage for Swhere
S: Storage + 'static,
Source§fn dyn_mem_align(&self) -> usize
fn dyn_mem_align(&self) -> usize
Wrapper around
Storage::mem_align()
.Source§fn dyn_req_align(&self) -> usize
fn dyn_req_align(&self) -> usize
Wrapper around
Storage::req_align()
.Source§fn dyn_zero_align(&self) -> usize
fn dyn_zero_align(&self) -> usize
Wrapper around
Storage::zero_align()
.Source§fn dyn_discard_align(&self) -> usize
fn dyn_discard_align(&self) -> usize
Wrapper around
Storage::discard_align()
.Source§fn dyn_resolve_relative_path(&self, relative: &Path) -> Result<PathBuf, Error>
fn dyn_resolve_relative_path(&self, relative: &Path) -> Result<PathBuf, Error>
Wrapper around
Storage::resolve_relative_path()
.Source§fn dyn_get_filename(&self) -> Option<PathBuf>
fn dyn_get_filename(&self) -> Option<PathBuf>
Wrapper around
Storage::get_filename()
Source§unsafe fn dyn_pure_readv<'a>(
&'a self,
bufv: IoVectorMut<'a>,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>
unsafe fn dyn_pure_readv<'a>( &'a self, bufv: IoVectorMut<'a>, offset: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>
Object-safe wrapper around
Storage::pure_readv()
. Read moreSource§unsafe fn dyn_pure_writev<'a>(
&'a self,
bufv: IoVector<'a>,
offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>
unsafe fn dyn_pure_writev<'a>( &'a self, bufv: IoVector<'a>, offset: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a>>
Object-safe wrapper around
Storage::pure_writev()
. Read moreSource§unsafe fn dyn_pure_write_zeroes(
&self,
offset: u64,
length: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
unsafe fn dyn_pure_write_zeroes( &self, offset: u64, length: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Object-safe wrapper around
Storage::pure_write_zeroes()
. Read moreSource§unsafe fn dyn_pure_discard(
&self,
offset: u64,
length: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
unsafe fn dyn_pure_discard( &self, offset: u64, length: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Object-safe wrapper around
Storage::pure_discard()
. Read moreSource§fn dyn_flush(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
fn dyn_flush(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Object-safe wrapper around
Storage::flush()
.Source§fn dyn_sync(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
fn dyn_sync(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Object-safe wrapper around
Storage::sync()
.Source§unsafe fn dyn_invalidate_cache(
&self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
unsafe fn dyn_invalidate_cache( &self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Object-safe wrapper around
Storage::invalidate_cache()
. Read moreSource§fn dyn_get_storage_helper(&self) -> &CommonStorageHelper
fn dyn_get_storage_helper(&self) -> &CommonStorageHelper
Wrapper around
Storage::get_storage_helper()
.Source§fn dyn_resize(
&self,
new_size: u64,
prealloc_mode: PreallocateMode,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
fn dyn_resize( &self, new_size: u64, prealloc_mode: PreallocateMode, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + '_>>
Wrapper around
Storage::resize()
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<S> StorageExt for Swhere
S: Storage,
impl<S> StorageExt for Swhere
S: Storage,
Source§async fn write_zeroes(&self, offset: u64, length: u64) -> Result<(), Error>
async fn write_zeroes(&self, offset: u64, length: u64) -> Result<(), Error>
Ensure the given range reads back as zeroes.
Source§async fn discard(&self, offset: u64, length: u64) -> Result<(), Error>
async fn discard(&self, offset: u64, length: u64) -> Result<(), Error>
Discard the given range, with undefined contents when read back. Read more
Source§async fn weak_write_blocker(&self, range: Range<u64>) -> RangeBlockedGuard<'_>
async fn weak_write_blocker(&self, range: Range<u64>) -> RangeBlockedGuard<'_>
Await concurrent strong write blockers for the given range. Read more
Source§async fn strong_write_blocker(&self, range: Range<u64>) -> RangeBlockedGuard<'_>
async fn strong_write_blocker(&self, range: Range<u64>) -> RangeBlockedGuard<'_>
Await any concurrent write request for the given range. Read more