[][src]Enum japi::Link

pub enum Link {
    Url(String),
    Object {
        href: Option<String>,
        meta: Option<Meta>,
    },
}

A link object

Enum represents every valid configuration but in practice you should probably either use Links::Url for links with just a URL or Links::Object if you need to include a meta object

See the JSON:API docs for more information

Variants

Url(String)
Object

Fields of Object

href: Option<String>meta: Option<Meta>

Methods

impl Link[src]

pub fn href<'a>(&'a self) -> Option<&'a str>[src]

Grabs the url of the link regardless of its variant

pub fn new(url: String, meta: Option<Meta>) -> Self[src]

If meta is None will construct Link::Url instead of Link::Object

Trait Implementations

impl Clone for Link[src]

impl Debug for Link[src]

impl Default for Link[src]

Defaults to Link::Object with all fields None

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

impl PartialEq<Link> for Link[src]

impl Serialize for Link[src]

impl StructuralPartialEq for Link[src]

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

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: 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.