[−][src]Struct dybs::My
A dynamic exclusively-owning smart pointer to a value
Implementations
impl<T> My<T>
[src]
impl<T: ?Sized> My<T>
[src]
pub fn borrow(&self) -> Dyb<T>
[src]
Dynamically borrow the value
This borrow may live for any lifetime less than that of the bounds on the value itself - notably, this implies that (as far as the borrow-checker is concerned) it may outlive the owner itself!
This actually shifts the responsibility for ensuring the value lives long enough back onto the owner (just like the static borrow checker) with the caveat that dropping the value early will fail at runtime.
Dybs satisfies this requirement by leaking the value and panicking
in this case. The leaking ensures soundness as in the worst case the
value will just live forever, while panicking ensures the error is
reported at the appropriate time rather than unfairly blaming a Dyb
for holding a borrow for "too long" or entirely ignoring the problem.
Trait Implementations
impl<T: Clone> Clone for My<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized> Deref for My<T>
[src]
impl<T: ?Sized> Drop for My<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for My<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for My<T>
impl<T> !Sync for My<T>
impl<T: ?Sized> Unpin for My<T>
impl<T: ?Sized> UnwindSafe for My<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,