pub struct HostTreePointer<T> { /* private fields */ }Expand description
A pointer to an object that is safe to dereference from any thread, if the Host lock for the specified host is held.
Implementations§
Source§impl<T> HostTreePointer<T>
impl<T> HostTreePointer<T>
Sourcepub fn new_for_host(host_id: HostId, ptr: *mut T) -> Self
pub fn new_for_host(host_id: HostId, ptr: *mut T) -> Self
Create a pointer that may only be accessed when the host with id
host_id is active.
Sourcepub fn new(ptr: *mut T) -> Self
pub fn new(ptr: *mut T) -> Self
Create a pointer that may only be accessed when the current host is active.
Sourcepub unsafe fn ptr(&self) -> *mut T
pub unsafe fn ptr(&self) -> *mut T
Get the pointer.
Panics if the configured host is not active.
§Safety
Pointer must only be dereferenced while the configures Host is still active, in addition to the normal safety requirements for dereferencing a pointer.
Sourcepub unsafe fn ptr_with_host(&self, host: &Host) -> *mut T
pub unsafe fn ptr_with_host(&self, host: &Host) -> *mut T
Get the pointer.
Panics if host is not the one associated with self.
§Safety
Pointer must only be dereferenced while the configures Host is still active, in addition to the normal safety requirements for dereferencing a pointer.
Sourcepub unsafe fn ptr_unchecked(&self) -> *mut T
pub unsafe fn ptr_unchecked(&self) -> *mut T
Get the pointer without checking the active host.
§Safety
Pointer must only be dereferenced while the configures Host is still active, in addition to the normal safety requirements for dereferencing a pointer.
Trait Implementations§
Source§impl<T> Clone for HostTreePointer<T>
impl<T> Clone for HostTreePointer<T>
Source§impl<T: Debug> Debug for HostTreePointer<T>
impl<T: Debug> Debug for HostTreePointer<T>
impl<T> Copy for HostTreePointer<T>
impl<T> Send for HostTreePointer<T>
impl<T> Sync for HostTreePointer<T>
Auto Trait Implementations§
impl<T> Freeze for HostTreePointer<T>
impl<T> RefUnwindSafe for HostTreePointer<T>where
T: RefUnwindSafe,
impl<T> Unpin for HostTreePointer<T>
impl<T> UnwindSafe for HostTreePointer<T>where
T: RefUnwindSafe,
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
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>
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>
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