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>) -> Self
pub fn none() -> Self
pub fn is_none(&self) -> bool
pub fn cid(&self) -> &Option<Cid>
pub fn set(&mut self, cid: Option<Cid>)
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§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§impl<'de, T> Deserialize<'de> for OptionLink<T>
impl<'de, T> Deserialize<'de> for OptionLink<T>
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<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§impl<T> From<Cid<64>> for OptionLink<T>
impl<T> From<Cid<64>> for OptionLink<T>
Source§impl<T> From<Link<T>> for OptionLink<T>
impl<T> From<Link<T>> for OptionLink<T>
Source§impl<T> From<OptionLink<T>> for Option<Cid>
impl<T> From<OptionLink<T>> for Option<Cid>
Source§fn from(val: OptionLink<T>) -> Self
fn from(val: OptionLink<T>) -> Self
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> JsonSchema for OptionLink<T>
impl<T: JsonSchema> JsonSchema for OptionLink<T>
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> Ord for OptionLink<T>
impl<T> Ord for OptionLink<T>
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>
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