Struct activitypub::CustomLink [−][src]
pub struct CustomLink<C, L> { pub link: L, pub custom_props: C, }
A custom type extending Link
CustomLink allows for providing a pre-defined Link type, and a set of extending properties, and treating those two items as a single Link type.
Example
use activitystreams_types::{ CustomLink, link::Mention, }; struct MyProps { some_prop: String, } fn main() { let mention = Mention::default(); let extended_mention = CustomLink::new(mention, MyProps { some_prop: "hey".to_owned() }); }
Fields
link: L
custom_props: C
Methods
impl<C, L> CustomLink<C, L> where
L: Link,
[src]
impl<C, L> CustomLink<C, L> where
L: Link,
pub fn new(link: L, custom_props: C) -> CustomLink<C, L>
[src]
pub fn new(link: L, custom_props: C) -> CustomLink<C, L>
Trait Implementations
impl<C, L> Link for CustomLink<C, L> where
C: DeserializeOwned + Serialize,
L: Link,
[src]
impl<C, L> Link for CustomLink<C, L> where
C: DeserializeOwned + Serialize,
L: Link,
impl<'de, C, L> Deserialize<'de> for CustomLink<C, L> where
C: Deserialize<'de>,
L: Deserialize<'de>,
[src]
impl<'de, C, L> Deserialize<'de> for CustomLink<C, L> where
C: Deserialize<'de>,
L: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<CustomLink<C, L>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<CustomLink<C, L>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<C, L> Serialize for CustomLink<C, L> where
C: Serialize,
L: Serialize,
[src]
impl<C, L> Serialize for CustomLink<C, L> where
C: Serialize,
L: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<C, L> Clone for CustomLink<C, L> where
C: Clone,
L: Clone,
[src]
impl<C, L> Clone for CustomLink<C, L> where
C: Clone,
L: Clone,
fn clone(&self) -> CustomLink<C, L>
[src]
fn clone(&self) -> CustomLink<C, L>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<C, L> Debug for CustomLink<C, L> where
C: Debug,
L: Debug,
[src]
impl<C, L> Debug for CustomLink<C, L> where
C: Debug,
L: Debug,
Auto Trait Implementations
impl<C, L> Send for CustomLink<C, L> where
C: Send,
L: Send,
impl<C, L> Send for CustomLink<C, L> where
C: Send,
L: Send,
impl<C, L> Sync for CustomLink<C, L> where
C: Sync,
L: Sync,
impl<C, L> Sync for CustomLink<C, L> where
C: Sync,
L: Sync,