pub struct BytesStorage { /* private fields */ }Expand description
The bytes storage maps IDs to reference-counted, initialized allocations. Removing an ID prevents new lookups; outstanding resources/guards keep the allocation alive until their last owner is dropped.
Implementations§
Source§impl BytesStorage
impl BytesStorage
Sourcepub fn try_get(
&self,
handle: &StorageHandle,
) -> Result<BytesResource, BytesAccessError>
pub fn try_get( &self, handle: &StorageHandle, ) -> Result<BytesResource, BytesAccessError>
Validate an ID and its byte range before exposing a resource.
Trait Implementations§
Source§impl ComputeStorage for BytesStorage
impl ComputeStorage for BytesStorage
Source§type Resource = BytesResource
type Resource = BytesResource
The resource associated type determines the way data is implemented and how
it can be accessed by kernels.
Source§fn get(&mut self, handle: &StorageHandle) -> Self::Resource
fn get(&mut self, handle: &StorageHandle) -> Self::Resource
Returns the underlying resource for a specified storage handle
Source§fn alloc(&mut self, size: u64) -> Result<StorageHandle, IoError>
fn alloc(&mut self, size: u64) -> Result<StorageHandle, IoError>
Allocates
size units of memory and returns a handle to itSource§impl Debug for BytesStorage
impl Debug for BytesStorage
Auto Trait Implementations§
impl !RefUnwindSafe for BytesStorage
impl !UnwindSafe for BytesStorage
impl Freeze for BytesStorage
impl Send for BytesStorage
impl Sync for BytesStorage
impl Unpin for BytesStorage
impl UnsafeUnpin for BytesStorage
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