#[non_exhaustive]pub struct JrdLink {
pub rel: String,
pub media_type: Option<String>,
pub href: Option<Url>,
pub titles: BTreeMap<String, String>,
pub properties: BTreeMap<String, Option<String>>,
pub template: Option<String>,
}Expand description
A link entry inside a Jrd.
Per RFC 7033 §4.4.4, the href and template members are
mutually exclusive: only one MUST be present in a given link. This
invariant is checked at runtime by JrdLink::validate and asserted
by JrdLinkBuilder in debug builds.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rel: StringLink relation (IANA registered name or URI).
media_type: Option<String>Media type of the resource referenced by href.
href: Option<Url>URI of the related resource.
titles: BTreeMap<String, String>Localised titles keyed by BCP-47 language tag.
properties: BTreeMap<String, Option<String>>Link-specific properties.
template: Option<String>URI template for links that synthesise a URI from parameters.
Implementations§
Source§impl JrdLink
impl JrdLink
Sourcepub fn builder(rel: impl Into<String>) -> JrdLinkBuilder
pub fn builder(rel: impl Into<String>) -> JrdLinkBuilder
Returns a new JrdLinkBuilder.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JrdLink
impl<'de> Deserialize<'de> for JrdLink
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
impl Eq for JrdLink
impl StructuralPartialEq for JrdLink
Auto Trait Implementations§
impl Freeze for JrdLink
impl RefUnwindSafe for JrdLink
impl Send for JrdLink
impl Sync for JrdLink
impl Unpin for JrdLink
impl UnsafeUnpin for JrdLink
impl UnwindSafe for JrdLink
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.