[−][src]Struct stadium::RawHandle
A handle to a T
that does not own a T
. This handle dos not remember
what stadium created it.
Implementations
impl RawHandle
[src]
pub unsafe fn trust<T>(self, stadium: &Stadium<'_>) -> Handle<T>
[src]
Recreate an Handle
from this RawHandle
.
Safety
- The generic type parameter
T
must be the same as the originalHandle
that was used to produce thisRawHandle
. - The given
Stadium
must be the one associated with the original handle.
Example
let mut builder = stadium::builder(); let handle = builder.insert(5i32); let stadium = builder.build(); let raw_handle = handle.raw(); // SAFETY: The handle was given by the builder that created the stadium and was // created for a `i32`. let handle = unsafe { raw_handle.trust::<i32>(&stadium) }; assert_eq!(stadium[handle], 5);
pub unsafe fn trust_with_builder<T>(self, builder: &Builder<'_>) -> Handle<T>
[src]
Recreate an Handle
from this RawHandle
.
Safety
- The generic type parameter
T
must be the same as the originalHandle
that was used to produce thisRawHandle
. - The given
Builder
must be the one associated with the original handle.
Example
let mut builder = stadium::builder(); let raw_handle = builder.insert(5i32).raw(); // SAFETY: The handle was given by this builder and was created for a `i32`. let handle = unsafe { raw_handle.trust_with_builder::<i32>(&builder) }; let stadium = builder.build(); assert_eq!(stadium[handle], 5);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RawHandle
[src]
impl Send for RawHandle
[src]
impl Sync for RawHandle
[src]
impl Unpin for RawHandle
[src]
impl UnwindSafe for RawHandle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,