Struct activitystreams_types::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: Object> CustomObject<C, O>
[src]

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<C: Debug, O: Debug> Debug for CustomObject<C, O>
[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]

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

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

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

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

impl<C, O> IntransitiveActivity for CustomObject<C, O> where
    C: DeserializeOwned + Serialize,
    O: IntransitiveActivity
[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