Struct activitypub::CustomObject[][src]

pub struct CustomObject<C, O> {
    pub object: O,
    pub custom_props: C,
}

A custom type extending Object

CustomObject allows for providing a pre-defined Link type, and a set of extending properties, and treating those two items as a single Object type.

This type can also be used to extend any type deriving from Object, such as Actor, Activity, or Collection.

Example

use activitystreams_types::{
    CustomObject,
    object::Video,
};

struct MyProps {
    some_prop: String,
}

fn main() {
    let video = Video::default();
    let extended_video = CustomObject::new(video, MyProps { some_prop: "hey".to_owned() });
}

Fields

Methods

impl<C, O> CustomObject<C, O> where
    O: Object
[src]

Trait Implementations

impl<C, O> Activity for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: Activity
[src]

impl<'de, C, O> Deserialize<'de> for CustomObject<C, O> where
    C: Deserialize<'de>,
    O: Deserialize<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<C, O> Serialize for CustomObject<C, O> where
    C: Serialize,
    O: Serialize
[src]

Serialize this value into the given Serde serializer. Read more

impl<C, O> Collection for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: Collection
[src]

impl<C, O> Actor for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: Actor
[src]

impl<C, O> IntransitiveActivity for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: IntransitiveActivity
[src]

impl<C, O> Clone for CustomObject<C, O> where
    C: Clone,
    O: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<C, O> CollectionPage for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: CollectionPage
[src]

impl<C, O> Debug for CustomObject<C, O> where
    C: Debug,
    O: Debug
[src]

Formats the value using the given formatter. Read more

impl<C, O> Object for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: Object
[src]

Auto Trait Implementations

impl<C, O> Send for CustomObject<C, O> where
    C: Send,
    O: Send

impl<C, O> Sync for CustomObject<C, O> where
    C: Sync,
    O: Sync