[][src]Struct activitystreams::BaseBox

pub struct BaseBox(_);

A wrapper type around a generic Base

Implementations

impl BaseBox[src]

pub fn from_concrete<T>(t: T) -> Result<Self, Error> where
    T: Base + 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: Base + 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 BaseBox[src]

impl Debug for BaseBox[src]

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

impl From<BaseBox> for ActivityPropertiesResultTermEnum[src]

impl From<BaseBox> for ActivityPropertiesInstrumentTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptTargetPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptTargetPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptTargetPropertiesTargetTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOriginPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOriginPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOriginPropertiesOriginTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOthersPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOthersPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOthersPropertiesOriginTermEnum[src]

impl From<BaseBox> for ActorAndObjectOptOthersPropertiesTargetTermEnum[src]

impl From<BaseBox> for ActorOptOriginAndTargetPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndOriginPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndOriginPropertiesOriginTermEnum[src]

impl From<BaseBox> for QuestionPropertiesOneOfTermEnum[src]

impl From<BaseBox> for QuestionPropertiesAnyOfTermEnum[src]

impl From<BaseBox> for CollectionPropertiesItemsTermEnum[src]

impl From<BaseBox> for CollectionPropertiesCurrentEnum[src]

impl From<BaseBox> for CollectionPropertiesFirstEnum[src]

impl From<BaseBox> for CollectionPropertiesLastTermEnum[src]

impl From<BaseBox> for CollectionPagePropertiesPartOfEnum[src]

impl From<BaseBox> for CollectionPagePropertiesNextEnum[src]

impl From<BaseBox> for ActorOptOriginAndTargetPropertiesOriginTermEnum[src]

impl From<BaseBox> for CollectionPagePropertiesPrevEnum[src]

impl From<BaseBox> for ObjectPropertiesAttachmentTermEnum[src]

impl From<BaseBox> for ObjectPropertiesAttributedToTermEnum[src]

impl From<BaseBox> for ObjectPropertiesAudienceTermEnum[src]

impl From<BaseBox> for ObjectPropertiesContextTermEnum[src]

impl From<BaseBox> for ObjectPropertiesGeneratorTermEnum[src]

impl From<BaseBox> for ObjectPropertiesInReplyToTermEnum[src]

impl From<BaseBox> for ObjectPropertiesLocationTermEnum[src]

impl From<BaseBox> for ObjectPropertiesPreviewTermEnum[src]

impl From<BaseBox> for ObjectPropertiesRepliesTermEnum[src]

impl From<BaseBox> for ActorOptOriginAndTargetPropertiesTargetTermEnum[src]

impl From<BaseBox> for ObjectPropertiesTagTermEnum[src]

impl From<BaseBox> for ObjectPropertiesToTermEnum[src]

impl From<BaseBox> for ObjectPropertiesBtoTermEnum[src]

impl From<BaseBox> for ObjectPropertiesCcTermEnum[src]

impl From<BaseBox> for ObjectPropertiesBccTermEnum[src]

impl From<BaseBox> for RelationshipPropertiesSubjectEnum[src]

impl From<BaseBox> for RelationshipPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorAndObjectPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorAndObjectPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorObjectAndTargetPropertiesActorTermEnum[src]

impl From<BaseBox> for ActorObjectAndTargetPropertiesObjectTermEnum[src]

impl From<BaseBox> for ActorObjectAndTargetPropertiesTargetTermEnum[src]

impl Serialize for BaseBox[src]

impl TryFrom<AMove> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Accept> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Add> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Announce> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Application> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Arrive> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Article> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Audio> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Block> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Create> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Delete> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Dislike> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Document> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Event> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

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 TryFrom<Flag> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Follow> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Group> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Ignore> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Image> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Invite> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Join> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Leave> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Like> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Listen> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Mention> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Note> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Offer> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<OrderedCollection> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<OrderedCollectionPage> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Organization> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Page> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Person> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Place> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Profile> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Question> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Read> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Reject> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Relationship> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Remove> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Service> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<TentativeAccept> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<TentativeReject> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Tombstone> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Travel> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Undo> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<UnorderedCollection> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<UnorderedCollectionPage> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Update> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Video> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<View> for BaseBox[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for BaseBox

impl Send for BaseBox

impl Sync for BaseBox

impl Unpin for BaseBox

impl UnwindSafe for BaseBox

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.