[−][src]Struct activitystreams::link::LinkBox
A wrapper type around a generic Link
Implementations
impl LinkBox
[src]
pub fn from_concrete<T>(t: T) -> Result<Self, Error> where
T: Link + Serialize,
[src]
T: Link + Serialize,
Coerce a concrete type into this wrapper type
This is done automatically via TryFrom in proprties setter methods
pub fn into_concrete<T>(self) -> Result<T, Error> where
T: Link + DeserializeOwned,
[src]
T: Link + DeserializeOwned,
Attempt to deserialize the wrapper type to a concrete type
Before this method is called, the type should be verified via the kind
or
is_kind
methods
pub fn is_kind(&self, kind: impl Display) -> bool
[src]
Return whether the given wrapper type is expected.
For example
ⓘThis example is not tested
use activitystreams::object::{ kind::ImageType, apub::Image, }; if my_wrapper_type.is_kind(ImageType) { let image = my_wrapper_type.into_concrete::<Image>()?; ... }
pub fn kind(&self) -> Option<&str>
[src]
Return the kind of wrapper type, if present
Example
ⓘThis example is not tested
match my_wrapper_type.kind() { Some("Image") => { let image = my_wrapper_type.into_concrete::<Image>()?; ... } _ => ..., }
Trait Implementations
impl Clone for LinkBox
[src]
impl Debug for LinkBox
[src]
impl<'de> Deserialize<'de> for LinkBox
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<LinkBox> for LinkPropertiesContextTermEnum
[src]
fn from(item: LinkBox) -> LinkPropertiesContextTermEnum
[src]
impl From<LinkBox> for LinkPropertiesPreviewTermEnum
[src]
fn from(item: LinkBox) -> LinkPropertiesPreviewTermEnum
[src]
impl From<LinkBox> for ObjectPropertiesIconTermEnum
[src]
fn from(item: LinkBox) -> ObjectPropertiesIconTermEnum
[src]
impl From<LinkBox> for ObjectPropertiesImageTermEnum
[src]
fn from(item: LinkBox) -> ObjectPropertiesImageTermEnum
[src]
impl From<LinkBox> for ObjectPropertiesUrlTermEnum
[src]
fn from(item: LinkBox) -> ObjectPropertiesUrlTermEnum
[src]
impl Serialize for LinkBox
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T, U> TryFrom<Ext<T, U>> for LinkBox where
T: Link + Serialize,
U: Extension<T> + Serialize + Debug,
[src]
T: Link + Serialize,
U: Extension<T> + Serialize + Debug,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(e: Ext<T, U>) -> Result<Self, Self::Error>
[src]
impl TryFrom<Mention> for LinkBox
[src]
Auto Trait Implementations
impl RefUnwindSafe for LinkBox
impl Send for LinkBox
impl Sync for LinkBox
impl Unpin for LinkBox
impl UnwindSafe for LinkBox
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,