pub struct CustomLink<C, L> {
pub link: L,
pub custom_props: C,
}
Expand description
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
Implementations§
Trait Implementations§
Source§impl<C: Clone, L: Clone> Clone for CustomLink<C, L>
impl<C: Clone, L: Clone> Clone for CustomLink<C, L>
Source§fn clone(&self) -> CustomLink<C, L>
fn clone(&self) -> CustomLink<C, L>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, C, L> Deserialize<'de> for CustomLink<C, L>where
C: Deserialize<'de>,
L: Deserialize<'de>,
impl<'de, C, L> Deserialize<'de> for CustomLink<C, L>where
C: Deserialize<'de>,
L: 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<C, L> Serialize for CustomLink<C, L>
impl<C, L> Serialize for CustomLink<C, L>
impl<C, L> Link for CustomLink<C, L>
Auto Trait Implementations§
impl<C, L> Freeze for CustomLink<C, L>
impl<C, L> RefUnwindSafe for CustomLink<C, L>where
L: RefUnwindSafe,
C: RefUnwindSafe,
impl<C, L> Send for CustomLink<C, L>
impl<C, L> Sync for CustomLink<C, L>
impl<C, L> Unpin for CustomLink<C, L>
impl<C, L> UnwindSafe for CustomLink<C, L>where
L: UnwindSafe,
C: 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