pub struct UntypedResource { /* private fields */ }Expand description
An untyped resource that may be inserted into UntypedResources.
Implementations§
Source§impl UntypedResource
impl UntypedResource
Sourcepub unsafe fn new_raw(info: UntypedResourceInfo) -> UntypedResource
pub unsafe fn new_raw(info: UntypedResourceInfo) -> UntypedResource
Create a new UntypedResource from raw UntypedResourceInfo.
§Safety
- The implementations for
info.clone_fnandinfo.drop_fnmust not do anything unsound when given valid pointers to clone or drop. - The
info.cellmust contain a pointer that is writable and points to data with a layout matchinginfo.layout.
Sourcepub fn new<T>(resource: T) -> UntypedResource
pub fn new<T>(resource: T) -> UntypedResource
Creates a new UntypedResource from an instance of a Rust type.
This is the safest way to construct a valid UntypedResource.
Trait Implementations§
Source§impl Clone for UntypedResource
impl Clone for UntypedResource
Source§fn clone(&self) -> UntypedResource
fn clone(&self) -> UntypedResource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Drop for UntypedResource
impl Drop for UntypedResource
impl Send for UntypedResource
impl Sync for UntypedResource
Auto Trait Implementations§
impl Freeze for UntypedResource
impl !RefUnwindSafe for UntypedResource
impl Unpin for UntypedResource
impl !UnwindSafe for UntypedResource
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more