[][src]Struct activitystreams::object::ObjectBox

pub struct ObjectBox(_);

A wrapper type around a generic Object

Implementations

impl ObjectBox[src]

pub fn from_concrete<T>(t: T) -> Result<Self, Error> where
    T: Object + Serialize
[src]

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: Object + DeserializeOwned
[src]

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 ObjectBox[src]

impl Debug for ObjectBox[src]

impl<'de> Deserialize<'de> for ObjectBox[src]

impl From<ObjectBox> for LinkPropertiesContextTermEnum[src]

impl From<ObjectBox> for LinkPropertiesPreviewTermEnum[src]

impl From<ObjectBox> for ProfilePropertiesDescribesEnum[src]

impl From<ObjectBox> for RelationshipPropertiesRelationshipTermEnum[src]

impl From<ObjectBox> for TombstonePropertiesFormerTypeTermEnum[src]

impl From<ObjectBox> for ApObjectPropertiesSourceEnum[src]

impl Serialize for ObjectBox[src]

impl TryFrom<AMove> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Accept> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Add> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Announce> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Application> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Arrive> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Article> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Audio> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Block> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Create> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Delete> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Dislike> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Document> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Event> for ObjectBox[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 TryFrom<Flag> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Follow> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Group> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Ignore> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Image> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Invite> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Join> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Leave> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Like> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Listen> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Note> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Offer> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<OrderedCollection> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<OrderedCollectionPage> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Page> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Person> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Place> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Profile> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Question> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Read> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Reject> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Relationship> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Remove> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Service> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<TentativeAccept> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<TentativeReject> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Tombstone> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Travel> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Undo> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<UnorderedCollection> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<UnorderedCollectionPage> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Update> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Video> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<View> for ObjectBox[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

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> 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.