pub struct Webfinger {
pub aliases: Vec<String>,
pub links: Vec<Link>,
pub subject: String,
}Expand description
The webfinger type
Webfinger data has three parts
- aliases
- links
- subject
subject defines the name or primary identifier of the object being looked up.
aliases are alternate names for the object.
links are references to more information about the subject, and can be in a variety of
formats. For example, some links will reference activitypub person objects, and others will
contain public key data.
This type can be serialized and deserialized
Fields§
§aliases: Vec<String>§links: Vec<Link>§subject: StringImplementations§
Source§impl Webfinger
impl Webfinger
Sourcepub fn add_aliases(&mut self, aliases: &[String]) -> &mut Self
pub fn add_aliases(&mut self, aliases: &[String]) -> &mut Self
Add multiple aliases to the Webfinger
Sourcepub fn add_activitypub(&mut self, href: &str) -> &mut Self
pub fn add_activitypub(&mut self, href: &str) -> &mut Self
Add an ActivityPub link to this Webfinger
Since ActivityPub extends JsonLD, this also adds an ActivityStreams JsonLD link
Sourcepub fn add_json_ld(&mut self, href: &str, profile: &str) -> &mut Self
pub fn add_json_ld(&mut self, href: &str, profile: &str) -> &mut Self
Add a JsonLD Link to this Webfinger
Sourcepub fn activitypub(&self) -> Option<&Link>
pub fn activitypub(&self) -> Option<&Link>
Get an ActivityPub link from this Webfinger
Sourcepub fn add_profile(&mut self, href: &str) -> &mut Self
pub fn add_profile(&mut self, href: &str) -> &mut Self
Add a profile link to this Webfinger
Sourcepub fn add_salmon(&mut self, href: &str) -> &mut Self
pub fn add_salmon(&mut self, href: &str) -> &mut Self
Set a salmon link from this Webfinger
Sourcepub fn add_magic_public_key(&mut self, magic_public_key: &str) -> &mut Self
pub fn add_magic_public_key(&mut self, magic_public_key: &str) -> &mut Self
Set a magic public key link for this Webfinger
Sourcepub fn magic_public_key(&self) -> Option<&Link>
pub fn magic_public_key(&self) -> Option<&Link>
Get a magic public key link from this Webfinger
Sourcepub fn add_ostatus(&mut self, template: &str) -> &mut Self
pub fn add_ostatus(&mut self, template: &str) -> &mut Self
Set an ostatus link for this Webfinger
Sourcepub fn respond(self) -> HttpResponse
pub fn respond(self) -> HttpResponse
Turn this Webfinger into an actix web HttpResponse
Sourcepub async fn fetch(
client: &Client,
scheme: Option<&str>,
user: &str,
domain: &str,
https: bool,
) -> Result<Self, FetchError>
pub async fn fetch( client: &Client, scheme: Option<&str>, user: &str, domain: &str, https: bool, ) -> Result<Self, FetchError>
Fetch a webfinger with subject user from a given domain
This method takes a Client so derivative works can provide their own configured clients
rather this library generating it’s own http clients.