pub struct Opaque<T>(/* private fields */);Expand description
A type the block declares opaque. Lean cannot look inside a value of it or make one, so
nothing is converted: the value is the Rust value itself, in an object. It moves into Lean
and moves back out. A value the caller keeps is cloned, and so is one that Lean still
holds somewhere else when it comes out, which is why the type must be Clone.
Trait Implementations§
Source§impl<T: Clone + 'static> Codec for Opaque<T>
impl<T: Clone + 'static> Codec for Opaque<T>
Source§fn into_lean(value: T) -> Value<Self>
fn into_lean(value: T) -> Value<Self>
The Lean value of a Rust value that is given up. What can move is moved.
Source§fn to_lean(value: &T) -> Value<Self>
fn to_lean(value: &T) -> Value<Self>
The Lean value of a Rust value that stays with the caller. A copy.
Auto Trait Implementations§
impl<T> Forget for Opaque<T>
impl<T> Freeze for Opaque<T>where
PhantomData<T>: Freeze,
impl<T> Move for Opaque<T>
impl<T> RefUnwindSafe for Opaque<T>where
T: RefUnwindSafe,
impl<T> Send for Opaque<T>where
T: Send,
impl<T> Sync for Opaque<T>where
T: Sync,
impl<T> Unpin for Opaque<T>where
T: Unpin,
impl<T> UnsafeUnpin for Opaque<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for Opaque<T>where
T: UnwindSafe,
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