pub struct Null {
size: AtomicU64,
common_storage_helper: CommonStorageHelper,
}
Expand description
Null storage object.
Reading from this will always return zeroes, writing to it does nothing (except to potentially grow its virtual “file length”).
Fields§
§size: AtomicU64
Virtual “file length”.
common_storage_helper: CommonStorageHelper
Storage helper.
Implementations§
Trait Implementations§
Source§impl Storage for Null
impl Storage for Null
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 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 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 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 !Freeze for Null
impl RefUnwindSafe for Null
impl Send for Null
impl Sync for Null
impl Unpin for Null
impl UnwindSafe for Null
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