pub enum Ox<'a> {
Owned(OxMut<'a>),
Borrowed(OxRef<'a>),
}Expand description
Type-erased value with ownership tracking — like Cow but for any shape.
Variants§
Owned(OxMut<'a>)
We own this value and must drop it.
Borrowed(OxRef<'a>)
We’re borrowing this value; someone else drops it.
Implementations§
Source§impl Ox<'static>
impl Ox<'static>
Sourcepub fn from_boxed<T>(boxed: Box<T>, shape: &'static Shape) -> Self
pub fn from_boxed<T>(boxed: Box<T>, shape: &'static Shape) -> Self
Take ownership of a boxed value.
Sourcepub fn from_value<T>(value: T, shape: &'static Shape) -> Self
pub fn from_value<T>(value: T, shape: &'static Shape) -> Self
Take ownership of a value by boxing it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Ox<'a>
impl<'a> RefUnwindSafe for Ox<'a>
impl<'a> !Send for Ox<'a>
impl<'a> !Sync for Ox<'a>
impl<'a> Unpin for Ox<'a>
impl<'a> !UnwindSafe for Ox<'a>
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