[−][src]Struct activitystreams::object::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]
T: Object + 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: Object + DeserializeOwned,
[src]
T: Object + 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 ObjectBox
[src]
impl Debug for ObjectBox
[src]
impl<'de> Deserialize<'de> for ObjectBox
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<ObjectBox> for LinkPropertiesContextTermEnum
[src]
fn from(item: ObjectBox) -> LinkPropertiesContextTermEnum
[src]
impl From<ObjectBox> for LinkPropertiesPreviewTermEnum
[src]
fn from(item: ObjectBox) -> LinkPropertiesPreviewTermEnum
[src]
impl From<ObjectBox> for ProfilePropertiesDescribesEnum
[src]
fn from(item: ObjectBox) -> ProfilePropertiesDescribesEnum
[src]
impl From<ObjectBox> for RelationshipPropertiesRelationshipTermEnum
[src]
fn from(item: ObjectBox) -> RelationshipPropertiesRelationshipTermEnum
[src]
impl From<ObjectBox> for TombstonePropertiesFormerTypeTermEnum
[src]
fn from(item: ObjectBox) -> TombstonePropertiesFormerTypeTermEnum
[src]
impl From<ObjectBox> for ApObjectPropertiesSourceEnum
[src]
fn from(item: ObjectBox) -> ApObjectPropertiesSourceEnum
[src]
impl Serialize for ObjectBox
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl TryFrom<AMove> for ObjectBox
[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 ObjectBox
[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 ObjectBox
[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 ObjectBox
[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<Application> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Application) -> Result<Self, Self::Error>
[src]
impl TryFrom<Arrive> for ObjectBox
[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<Article> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Article) -> Result<Self, Self::Error>
[src]
impl TryFrom<Audio> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Audio) -> Result<Self, Self::Error>
[src]
impl TryFrom<Block> for ObjectBox
[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 ObjectBox
[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 ObjectBox
[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 ObjectBox
[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 TryFrom<Document> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Document) -> Result<Self, Self::Error>
[src]
impl TryFrom<Event> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Event) -> Result<Self, Self::Error>
[src]
impl<T, U> TryFrom<Ext<T, U>> for ObjectBox where
T: Object + Serialize,
U: Extension<T> + Serialize + Debug,
[src]
T: Object + 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 ObjectBox
[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 ObjectBox
[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<Group> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Group) -> Result<Self, Self::Error>
[src]
impl TryFrom<Ignore> for ObjectBox
[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<Image> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Image) -> Result<Self, Self::Error>
[src]
impl TryFrom<Invite> for ObjectBox
[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 ObjectBox
[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 ObjectBox
[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 ObjectBox
[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 ObjectBox
[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<Note> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Note) -> Result<Self, Self::Error>
[src]
impl TryFrom<Offer> for ObjectBox
[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<OrderedCollection> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: OrderedCollection) -> Result<Self, Self::Error>
[src]
impl TryFrom<OrderedCollectionPage> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: OrderedCollectionPage) -> Result<Self, Self::Error>
[src]
impl TryFrom<Page> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Page) -> Result<Self, Self::Error>
[src]
impl TryFrom<Person> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Person) -> Result<Self, Self::Error>
[src]
impl TryFrom<Place> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Place) -> Result<Self, Self::Error>
[src]
impl TryFrom<Profile> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Profile) -> Result<Self, Self::Error>
[src]
impl TryFrom<Question> for ObjectBox
[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 ObjectBox
[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 ObjectBox
[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<Relationship> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Relationship) -> Result<Self, Self::Error>
[src]
impl TryFrom<Remove> for ObjectBox
[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<Service> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Service) -> Result<Self, Self::Error>
[src]
impl TryFrom<TentativeAccept> for ObjectBox
[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 ObjectBox
[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<Tombstone> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Tombstone) -> Result<Self, Self::Error>
[src]
impl TryFrom<Travel> for ObjectBox
[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 ObjectBox
[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<UnorderedCollection> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: UnorderedCollection) -> Result<Self, Self::Error>
[src]
impl TryFrom<UnorderedCollectionPage> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: UnorderedCollectionPage) -> Result<Self, Self::Error>
[src]
impl TryFrom<Update> for ObjectBox
[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<Video> for ObjectBox
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: Video) -> Result<Self, Self::Error>
[src]
impl TryFrom<View> for ObjectBox
[src]
Auto Trait Implementations
impl RefUnwindSafe for ObjectBox
impl Send for ObjectBox
impl Sync for ObjectBox
impl Unpin for ObjectBox
impl UnwindSafe for ObjectBox
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>,