#[non_exhaustive]pub struct Jrd {
pub subject: String,
pub aliases: Vec<String>,
pub properties: BTreeMap<String, Option<String>>,
pub links: Vec<JrdLink>,
}Expand description
A WebFinger JSON Resource Descriptor (JRD).
JRDs are emitted by the /.well-known/webfinger endpoint to describe a
resource identified by the subject field. Each JRD may declare
aliases for the same resource, scalar
properties drawn from arbitrary URI schemes, and
a list of links to related resources.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.subject: StringThe URI of the resource described by this JRD.
aliases: Vec<String>Alternative URIs that also identify the subject.
properties: BTreeMap<String, Option<String>>Scalar properties keyed by URI. Per RFC 7033 a property value may be
either a string or JSON null.
links: Vec<JrdLink>Links describing related resources.
Implementations§
Source§impl Jrd
impl Jrd
Sourcepub fn builder(subject: impl Into<String>) -> JrdBuilder
pub fn builder(subject: impl Into<String>) -> JrdBuilder
Returns a new JrdBuilder initialised with the given subject.
Sourcepub fn find_link(&self, rel: &str) -> Option<&JrdLink>
pub fn find_link(&self, rel: &str) -> Option<&JrdLink>
Finds the first link with the given rel.
Sourcepub fn activitypub_actor(&self) -> Option<&JrdLink>
pub fn activitypub_actor(&self) -> Option<&JrdLink>
Returns the ActivityPub actor link for this subject.
The canonical form is rel="self" with
type="application/activity+json". If no such link exists but one
with the JSON-LD profile media type does, that is returned instead.
Media-type matching is performed against the bare
type/subtype prefix so a parameter-carrying header like
application/ld+json; profile="…" still matches, while
unrelated subtypes that happen to share a string prefix
(e.g. application/ld+jsonx) do not.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Jrd
impl<'de> Deserialize<'de> for Jrd
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>,
impl Eq for Jrd
impl StructuralPartialEq for Jrd
Auto Trait Implementations§
impl Freeze for Jrd
impl RefUnwindSafe for Jrd
impl Send for Jrd
impl Sync for Jrd
impl Unpin for Jrd
impl UnsafeUnpin for Jrd
impl UnwindSafe for Jrd
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
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
key and return true if they are equal.