pub struct OptionLink<T> { /* private fields */ }Expand description
A (serializable) typed link.
Implementations§
Source§impl<T> OptionLink<T>
impl<T> OptionLink<T>
pub fn new(cid: Option<Cid<64>>) -> OptionLink<T>
pub fn none() -> OptionLink<T>
pub fn is_none(&self) -> bool
pub fn cid(&self) -> &Option<Cid<64>>
pub fn set(&mut self, cid: Option<Cid<64>>)
pub fn link(&self) -> Option<Link<T>>
pub fn unwrap(&self) -> Link<T>
pub fn expect(&self, message: &str) -> Link<T>
Trait Implementations§
Source§impl<T> Clone for OptionLink<T>
impl<T> Clone for OptionLink<T>
Source§fn clone(&self) -> OptionLink<T>
fn clone(&self) -> OptionLink<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for OptionLink<T>
impl<T> Debug for OptionLink<T>
Source§impl<T> Default for OptionLink<T>
impl<T> Default for OptionLink<T>
Source§fn default() -> OptionLink<T>
fn default() -> OptionLink<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for OptionLink<T>
impl<'de, T> Deserialize<'de> for OptionLink<T>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OptionLink<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OptionLink<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Display for OptionLink<T>
impl<T> Display for OptionLink<T>
Source§impl<T> From<&Cid<64>> for OptionLink<T>
impl<T> From<&Cid<64>> for OptionLink<T>
Source§fn from(value: &Cid<64>) -> OptionLink<T>
fn from(value: &Cid<64>) -> OptionLink<T>
Converts to this type from the input type.
Source§impl<T> From<Cid<64>> for OptionLink<T>
impl<T> From<Cid<64>> for OptionLink<T>
Source§fn from(value: Cid<64>) -> OptionLink<T>
fn from(value: Cid<64>) -> OptionLink<T>
Converts to this type from the input type.
Source§impl<T> From<Link<T>> for OptionLink<T>
impl<T> From<Link<T>> for OptionLink<T>
Source§fn from(value: Link<T>) -> OptionLink<T>
fn from(value: Link<T>) -> OptionLink<T>
Converts to this type from the input type.
Source§impl<T> Hash for OptionLink<T>
impl<T> Hash for OptionLink<T>
Source§impl<T> JsonSchema for OptionLink<T>where
T: JsonSchema,
impl<T> JsonSchema for OptionLink<T>where
T: JsonSchema,
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl<T> Linkable<T> for OptionLink<T>where
T: Default,
impl<T> Linkable<T> for OptionLink<T>where
T: Default,
Source§impl<T> Ord for OptionLink<T>
impl<T> Ord for OptionLink<T>
Source§fn cmp(&self, other: &OptionLink<T>) -> Ordering
fn cmp(&self, other: &OptionLink<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialEq for OptionLink<T>
impl<T> PartialEq for OptionLink<T>
Source§impl<T> PartialOrd for OptionLink<T>
impl<T> PartialOrd for OptionLink<T>
Source§impl<T> Serialize for OptionLink<T>
impl<T> Serialize for OptionLink<T>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Copy for OptionLink<T>
impl<T> Eq for OptionLink<T>
Auto Trait Implementations§
impl<T> Freeze for OptionLink<T>
impl<T> RefUnwindSafe for OptionLink<T>where
T: RefUnwindSafe,
impl<T> Send for OptionLink<T>where
T: Send,
impl<T> Sync for OptionLink<T>where
T: Sync,
impl<T> Unpin for OptionLink<T>where
T: Unpin,
impl<T> UnsafeUnpin for OptionLink<T>
impl<T> UnwindSafe for OptionLink<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more