pub struct Option<Element: MoveType> {
pub vec: MoveVec<Element>,
}
Expand description
Abstraction of a value that may or may not be present. Implemented with a vector of size zero or one because Move bytecode does not have ADTs.
Fields§
§vec: MoveVec<Element>
Implementations§
Source§impl<Element: MoveType> Option<Element>
impl<Element: MoveType> Option<Element>
pub fn move_instance( self, element: <Element as MoveType>::TypeTag, ) -> MoveInstance<Self>
pub fn type_(element: <Element as MoveType>::TypeTag) -> OptionTypeTag<Element>
Trait Implementations§
Source§impl<'de, Element: MoveType> Deserialize<'de> for Option<Element>
impl<'de, Element: MoveType> Deserialize<'de> for Option<Element>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Element: MoveType> MoveStruct for Option<Element>
impl<Element: MoveType> MoveStruct for Option<Element>
type StructTag = OptionTypeTag<Element>
Source§impl<Element: MoveType> MoveType for Option<Element>
impl<Element: MoveType> MoveType for Option<Element>
Source§impl<Element: MoveType> StaticModule for Option<Element>
impl<Element: MoveType> StaticModule for Option<Element>
fn module() -> Identifier
Source§impl<Element: MoveType> StaticName for Option<Element>
impl<Element: MoveType> StaticName for Option<Element>
fn name() -> Identifier
Source§impl<Element: MoveType + StaticTypeTag> StaticTypeParams for Option<Element>
impl<Element: MoveType + StaticTypeTag> StaticTypeParams for Option<Element>
fn type_params() -> Vec<TypeTag>
impl<Element: Eq + MoveType> Eq for Option<Element>
impl<Element: MoveType> StructuralPartialEq for Option<Element>
Auto Trait Implementations§
impl<Element> Freeze for Option<Element>
impl<Element> RefUnwindSafe for Option<Element>where
Element: RefUnwindSafe,
impl<Element> Send for Option<Element>where
Element: Send,
impl<Element> Sync for Option<Element>where
Element: Sync,
impl<Element> Unpin for Option<Element>where
Element: Unpin,
impl<Element> UnwindSafe for Option<Element>where
Element: 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