pub struct ManagedResource<Resource: Send> { /* private fields */ }Expand description
Access to the underlying resource.
Implementations§
Source§impl<Resource: Send> ManagedResource<Resource>
impl<Resource: Send> ManagedResource<Resource>
Sourcepub fn new(binding: ManagedMemoryBinding, resource: Resource) -> Self
pub fn new(binding: ManagedMemoryBinding, resource: Resource) -> Self
Constructs a new ManagedResource.
Source§impl<Resource: Send> ManagedResource<Resource>
impl<Resource: Send> ManagedResource<Resource>
Sourcepub fn resource(&self) -> &Resource
pub fn resource(&self) -> &Resource
access the underlying resource.
§Note
The resource might be bigger than the part required. (e.g. a big buffer where the handle only refers to a slice of it). Only the part required by the handle is guaranteed to remain, other parts of this resource will be re-used.
Trait Implementations§
Auto Trait Implementations§
impl<Resource> Freeze for ManagedResource<Resource>where
Resource: Freeze,
impl<Resource> !RefUnwindSafe for ManagedResource<Resource>
impl<Resource> Send for ManagedResource<Resource>
impl<Resource> Sync for ManagedResource<Resource>where
Resource: Sync,
impl<Resource> Unpin for ManagedResource<Resource>where
Resource: Unpin,
impl<Resource> UnsafeUnpin for ManagedResource<Resource>where
Resource: UnsafeUnpin,
impl<Resource> !UnwindSafe for ManagedResource<Resource>
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