[][src]Struct activitystreams::ext::Ext

pub struct Ext<T, U> {
    pub base: T,
    pub extension: U,
}

Defines an extension to an activitystreams object or link

This type provides two fields, the first field, base, should always the be base ActivityStreams type. As long as base implements an ActivityStreams trait, Ext will also.

For example, the type Ext<Video, HashMap<String, String>> will implement the Object trait, because Video implements that trait.

Additionally, AsRef and AsMut have been implemented for Ext. If type type Ext<Ext<Follow, SomeTime>, AnotherType> exists, that will implement AsRef<ActivityProperties> just like the innermost Follow.

Usage:

use activitystreams::object::Video;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut video = Video::full();

    // AsMut works even though this is an Ext<Video, ApObjectProperties>
    video
        .as_mut()
        .set_id("https://example.com")?;

    // set information on the extension
    video
        .extension
        .set_source_xsd_any_uri("https://example.com")?;

    Ok(())
}

Fields

base: T

The ActivityStreams base type, or another extension containing one

extension: U

The extension being applied to the type

Trait Implementations

impl<T, U> Activity for Ext<T, U> where
    T: Activity,
    U: Debug
[src]

impl<T, U> Actor for Ext<T, U> where
    T: Actor,
    U: Debug
[src]

impl<T, U, V> AsMut<V> for Ext<T, U> where
    T: Base + AsMut<V>,
    U: Extension<T> + Debug
[src]

impl<T, U, V> AsRef<V> for Ext<T, U> where
    T: Base + AsRef<V>,
    U: Extension<T> + Debug
[src]

impl<T, U> Base for Ext<T, U> where
    T: Base,
    U: Debug
[src]

impl<T: Clone, U: Clone> Clone for Ext<T, U>[src]

impl<T, U> Collection for Ext<T, U> where
    T: Collection,
    U: Debug
[src]

impl<T, U> CollectionPage for Ext<T, U> where
    T: CollectionPage,
    U: Debug
[src]

impl<T: Debug, U: Debug> Debug for Ext<T, U>[src]

impl<T: Default, U: Default> Default for Ext<T, U>[src]

impl<'de, T, U> Deserialize<'de> for Ext<T, U> where
    T: Deserialize<'de>,
    U: Deserialize<'de>, 
[src]

impl<T, U> IntransitiveActivity for Ext<T, U> where
    T: IntransitiveActivity,
    U: Debug
[src]

impl<T, U> Object for Ext<T, U> where
    T: Object,
    U: Debug
[src]

impl<T, U> Serialize for Ext<T, U> where
    T: Serialize,
    U: Serialize
[src]

impl<T, U> TryFrom<Ext<T, U>> for BaseBox where
    T: Base + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for ObjectBox where
    T: Object + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for LinkBox where
    T: Link + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for CollectionBox where
    T: Collection + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for CollectionPageBox where
    T: CollectionPage + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for ActivityBox where
    T: Activity + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for IntransitiveActivityBox where
    T: IntransitiveActivity + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<T, U> TryFrom<Ext<T, U>> for ActorBox where
    T: Actor + Serialize,
    U: Extension<T> + Serialize + Debug
[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T, U> RefUnwindSafe for Ext<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U> Send for Ext<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for Ext<T, U> where
    T: Sync,
    U: Sync

impl<T, U> Unpin for Ext<T, U> where
    T: Unpin,
    U: Unpin

impl<T, U> UnwindSafe for Ext<T, U> where
    T: UnwindSafe,
    U: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T, U> Extensible<U> for T where
    T: Base,
    U: Extension<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.