[][src]Struct activitystreams::object::properties::ApObjectProperties

pub struct ApObjectProperties {
    pub shares: Option<XsdAnyUri>,
    pub likes: Option<XsdAnyUri>,
    pub source: Option<ApObjectPropertiesSourceEnum>,
    pub upload_media: Option<ApObjectPropertiesUploadMediaEnum>,
}

Define activitypub properties for the Object type as described by the Activity Pub vocabulary.

Fields

shares: Option<XsdAnyUri>

This is a list of all Announce activities with this object as the object property, added as a side effect.

The shares collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

  • Range: anyUri
  • Functional: true
likes: Option<XsdAnyUri>

This is a list of all Like activities with this object as the object property, added as a side effect.

The likes collection MUST be either an OrderedCollection or a Collection and MAY be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

  • Range: anyUri
  • Functional: true
source: Option<ApObjectPropertiesSourceEnum>

The source property is intended to convey some sort of source from which the content markup was derived, as a form of provenance, or to support future editing by clients.

In general, clients do the conversion from source to content, not the other way around.

The value of source is itself an object which uses its own content and mediaType fields to supply source information.

  • Range: Object
  • Functional: true
upload_media: Option<ApObjectPropertiesUploadMediaEnum>

Servers MAY support uploading document types to be referenced in activites, such as images, video or other binary data, but the precise mechanism is out of scope for this version of ActivityPub.

The Social Web Community Group is refining the protocol in the ActivityPub Media Upload report.

  • Range: anyUri
  • Functional: false

Implementations

impl ApObjectProperties[src]

pub fn get_shares(&self) -> Option<&XsdAnyUri>[src]

Get shares as a XsdAnyUri

This returns None if there is no value present

pub fn set_shares<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Set the shares with a type that can be converted into XsdAnyUri

pub fn get_likes(&self) -> Option<&XsdAnyUri>[src]

Get likes as a XsdAnyUri

This returns None if there is no value present

pub fn set_likes<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Set the likes with a type that can be converted into XsdAnyUri

pub fn get_source_xsd_any_uri(&self) -> Option<&XsdAnyUri>[src]

Get source as a XsdAnyUri

This returns None if

  • There is no value present
  • The requested type is not the stored type

pub fn set_source_xsd_any_uri<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Set source with a value that can be converted into XsdAnyUri

pub fn get_source_object_box(&self) -> Option<&ObjectBox>[src]

Get source as a ObjectBox

This returns None if

  • There is no value present
  • The requested type is not the stored type

pub fn set_source_object_box<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<ObjectBox>>::Error> where
    T: TryInto<ObjectBox>, 
[src]

Set source with a value that can be converted into ObjectBox

pub fn get_upload_media(&self) -> Option<&XsdAnyUri>[src]

Get upload_media as a XsdAnyUri

This returns None if

  • There is no value present
  • There is more than one value present

pub fn set_upload_media<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Set the upload_media with a type that can be converted into XsdAnyUri

pub fn get_many_upload_medias(&self) -> Option<&[XsdAnyUri]>[src]

Get upload_media as a slice of XsdAnyUris

This returns None if

  • There is no value present
  • There is only one value present

pub fn set_many_upload_medias<T>(
    &mut self,
    item: Vec<T>
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Set the upload_media with a vector of types that can be converted into XsdAnyUris

pub fn add_upload_media<T>(
    &mut self,
    item: T
) -> Result<&mut Self, <T as TryInto<XsdAnyUri>>::Error> where
    T: TryInto<XsdAnyUri>, 
[src]

Add a type that can be converted into a XsdAnyUri to the upload_media vec

Trait Implementations

impl Clone for ApObjectProperties[src]

impl Debug for ApObjectProperties[src]

impl Default for ApObjectProperties[src]

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

impl<T> Extension<T> for ApObjectProperties where
    T: Object
[src]

impl Serialize for ApObjectProperties[src]

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.