pub struct Link { /* private fields */ }
Implementations
sourceimpl Link
impl Link
pub fn builder(
rel: Vec<impl Into<String>>,
href: impl Into<String>
) -> LinkBuilder
sourcepub fn classes(&self) -> &Option<Vec<String>>
pub fn classes(&self) -> &Option<Vec<String>>
Returns a reference to the Link’s Classes.
Examples
let link: Link = Link::builder(vec!["self"], "http://api.x.io/orders/42")
.classes(vec!["item"]).into();
assert_eq!(&Some(vec!["item".to_string()]), link.classes());
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
sourcefn 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
sourceimpl From<LinkBuilder> for Link
impl From<LinkBuilder> for Link
sourcefn from(builder: LinkBuilder) -> Link
fn from(builder: LinkBuilder) -> Link
Converts to this type from the input type.
impl StructuralPartialEq for Link
Auto Trait Implementations
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more