[−][src]Struct activitystreams::activity::ActivityBox
A wrapper type around a generic Activity
Implementations
impl ActivityBox
[src]
pub fn from_concrete<T>(t: T) -> Result<Self, Error> where
T: Activity + Serialize,
[src]
T: Activity + Serialize,
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: Activity + DeserializeOwned,
[src]
T: Activity + DeserializeOwned,
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
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
match my_wrapper_type.kind() { Some("Image") => { let image = my_wrapper_type.into_concrete::<Image>()?; ... } _ => ..., }
Trait Implementations
impl Clone for ActivityBox
[src]
fn clone(&self) -> ActivityBox
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ActivityBox
[src]
impl<'de> Deserialize<'de> for ActivityBox
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for ActivityBox
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl TryFrom<AMove> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: AMove) -> Result<Self, Self::Error>
[src]
impl TryFrom<Accept> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Accept) -> Result<Self, Self::Error>
[src]
impl TryFrom<Add> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Add) -> Result<Self, Self::Error>
[src]
impl TryFrom<Announce> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Announce) -> Result<Self, Self::Error>
[src]
impl TryFrom<Arrive> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Arrive) -> Result<Self, Self::Error>
[src]
impl TryFrom<Block> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Block) -> Result<Self, Self::Error>
[src]
impl TryFrom<Create> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Create) -> Result<Self, Self::Error>
[src]
impl TryFrom<Delete> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Delete) -> Result<Self, Self::Error>
[src]
impl TryFrom<Dislike> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Dislike) -> Result<Self, Self::Error>
[src]
impl<T, U> TryFrom<Ext<T, U>> for ActivityBox where
T: Activity + Serialize,
U: Extension<T> + Serialize + Debug,
[src]
T: Activity + Serialize,
U: Extension<T> + Serialize + Debug,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(e: Ext<T, U>) -> Result<Self, Self::Error>
[src]
impl TryFrom<Flag> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Flag) -> Result<Self, Self::Error>
[src]
impl TryFrom<Follow> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Follow) -> Result<Self, Self::Error>
[src]
impl TryFrom<Ignore> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Ignore) -> Result<Self, Self::Error>
[src]
impl TryFrom<Invite> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Invite) -> Result<Self, Self::Error>
[src]
impl TryFrom<Join> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Join) -> Result<Self, Self::Error>
[src]
impl TryFrom<Leave> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Leave) -> Result<Self, Self::Error>
[src]
impl TryFrom<Like> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Like) -> Result<Self, Self::Error>
[src]
impl TryFrom<Listen> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Listen) -> Result<Self, Self::Error>
[src]
impl TryFrom<Offer> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Offer) -> Result<Self, Self::Error>
[src]
impl TryFrom<Question> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Question) -> Result<Self, Self::Error>
[src]
impl TryFrom<Read> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Read) -> Result<Self, Self::Error>
[src]
impl TryFrom<Reject> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Reject) -> Result<Self, Self::Error>
[src]
impl TryFrom<Remove> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Remove) -> Result<Self, Self::Error>
[src]
impl TryFrom<TentativeAccept> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: TentativeAccept) -> Result<Self, Self::Error>
[src]
impl TryFrom<TentativeReject> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: TentativeReject) -> Result<Self, Self::Error>
[src]
impl TryFrom<Travel> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Travel) -> Result<Self, Self::Error>
[src]
impl TryFrom<Undo> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Undo) -> Result<Self, Self::Error>
[src]
impl TryFrom<Update> for ActivityBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Update) -> Result<Self, Self::Error>
[src]
impl TryFrom<View> for ActivityBox
[src]
Auto Trait Implementations
impl RefUnwindSafe for ActivityBox
impl Send for ActivityBox
impl Sync for ActivityBox
impl Unpin for ActivityBox
impl UnwindSafe for ActivityBox
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,