pub struct Ext<T, U> {
pub base: T,
pub extension: U,
}Expand description
Defines an extension to an activitystreams object or link
This type provides two fields, the first field, base, should always the be base
ActivityStreams type. As long as base implements an ActivityStreams trait, Ext will also.
For example, the type Ext<Video, HashMap<String, String>> will implement the Object trait,
because Video implements that trait.
Additionally, AsRef and AsMut have been implemented for Ext. If type type
Ext<Ext<Follow, SomeTime>, AnotherType> exists, that will implement
AsRef<ActivityProperties> just like the innermost Follow.
Usage:
use activitystreams::object::Video;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut video = Video::full();
// AsMut works even though this is an Ext<Video, ApObjectProperties>
video
.as_mut()
.set_id("https://example.com")?;
// set information on the extension
video
.extension
.set_source_xsd_any_uri("https://example.com")?;
Ok(())
}Fields§
§base: TThe ActivityStreams base type, or another extension containing one
extension: UThe extension being applied to the type
Trait Implementations§
Source§impl<'de, T, U> Deserialize<'de> for Ext<T, U>where
T: Deserialize<'de>,
U: Deserialize<'de>,
impl<'de, T, U> Deserialize<'de> for Ext<T, U>where
T: Deserialize<'de>,
U: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, U> TryFrom<Ext<T, U>> for ActivityBox
impl<T, U> TryFrom<Ext<T, U>> for ActivityBox
Source§impl<T, U> TryFrom<Ext<T, U>> for CollectionBox
impl<T, U> TryFrom<Ext<T, U>> for CollectionBox
Source§impl<T, U> TryFrom<Ext<T, U>> for CollectionPageBox
impl<T, U> TryFrom<Ext<T, U>> for CollectionPageBox
Source§impl<T, U> TryFrom<Ext<T, U>> for IntransitiveActivityBox
impl<T, U> TryFrom<Ext<T, U>> for IntransitiveActivityBox
impl<T, U> Activity for Ext<T, U>
impl<T, U> Actor for Ext<T, U>
impl<T, U> Base for Ext<T, U>
impl<T, U> Collection for Ext<T, U>where
T: Collection,
U: Debug,
impl<T, U> CollectionPage for Ext<T, U>where
T: CollectionPage,
U: Debug,
impl<T, U> IntransitiveActivity for Ext<T, U>where
T: IntransitiveActivity,
U: Debug,
impl<T, U> Link for Ext<T, U>
impl<T, U> Object for Ext<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Ext<T, U>
impl<T, U> RefUnwindSafe for Ext<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Ext<T, U>
impl<T, U> Sync for Ext<T, U>
impl<T, U> Unpin for Ext<T, U>
impl<T, U> UnsafeUnpin for Ext<T, U>where
T: UnsafeUnpin,
U: UnsafeUnpin,
impl<T, U> UnwindSafe for Ext<T, U>where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more