[][src]Struct activitystreams_new::actor::Endpoints

pub struct Endpoints<T> {
    pub proxy_url: Option<T>,
    pub oauth_authorization_endpoint: Option<T>,
    pub oauth_token_endpoint: Option<T>,
    pub provide_client_key: Option<T>,
    pub sign_client_key: Option<T>,
    pub shared_inbox: Option<T>,
}

A json object which maps additional (typically server/domain-wide) endpoints which may be useful either for this actor or someone referencing this actor.

This mapping may be nested inside the actor document as the value or may be a link to a JSON-LD document with these properties.

Fields

proxy_url: Option<T>

Endpoint URI so this actor's clients may access remote ActivityStreams objects which require authentication to access.

To use this endpoint, the client posts an x-www-form-urlencoded id parameter with the value being the id of the requested ActivityStreams object.

oauth_authorization_endpoint: Option<T>

If OAuth 2.0 bearer tokens RFC6749 RFC6750 are being used for authenticating client to server interactions, this endpoint specifies a URI at which a browser-authenticated user may obtain a new authorization grant.

oauth_token_endpoint: Option<T>

If OAuth 2.0 bearer tokens RFC6749 RFC6750 are being used for authenticating client to server interactions, this endpoint specifies a URI at which a client may acquire an access token.

provide_client_key: Option<T>

If Linked Data Signatures and HTTP Signatures are being used for authentication and authorization, this endpoint specifies a URI at which browser-authenticated users may authorize a client's public key for client to server interactions.

sign_client_key: Option<T>

If Linked Data Signatures and HTTP Signatures are being used for authentication and authorization, this endpoint specifies a URI at which a client key may be signed by the actor's key for a time window to act on behalf of the actor in interacting with foreign servers.

shared_inbox: Option<T>

An optional endpoint used for wide delivery of publicly addressed activities and activities sent to followers.

shared_inbox endpoints SHOULD also be publicly readable OrderedCollection objects containing objects addressed to the Public special collection. Reading from the shared_inbox endpoint MUST NOT present objects which are not addressed to the Public endpoint.

Methods

impl<T> Endpoints<T>[src]

pub fn as_ref(&self) -> Endpoints<&T>[src]

Borrow the current Endpoints struct

use activitystreams_new::{actor::Endpoints, uri};
use url::Url;

let uri = uri!("https://example.com");

let endpoints: Endpoints<Url> = Endpoints {
    shared_inbox: Some(uri.clone()),
    ..Default::default()
};

assert_eq!(endpoints.as_ref().shared_inbox, Some(&uri));

pub fn as_mut(&mut self) -> Endpoints<&mut T>[src]

Mutably borrow the endpoints struct

pub fn map<F, U>(self, f: F) -> Endpoints<U> where
    F: Fn(T) -> U + Copy
[src]

Map the URLs in Endpoints from T to U

use activitystreams_new::{actor::Endpoints, uri};
use url::Url;

let endpoints: Endpoints<Url> = Endpoints {
    shared_inbox: Some(uri!("https://example.com")),
    ..Default::default()
};

let endpoint_strings = endpoints.map(|u| u.to_string());

assert_eq!(endpoint_strings.shared_inbox, Some(String::from("https://example.com/")));

Trait Implementations

impl<T: Clone> Clone for Endpoints<T>[src]

impl<T: Debug> Debug for Endpoints<T>[src]

impl<T> Default for Endpoints<T>[src]

impl<'de, T> Deserialize<'de> for Endpoints<T> where
    T: Deserialize<'de>, 
[src]

impl<T> Serialize for Endpoints<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Endpoints<T> where
    T: RefUnwindSafe

impl<T> Send for Endpoints<T> where
    T: Send

impl<T> Sync for Endpoints<T> where
    T: Sync

impl<T> Unpin for Endpoints<T> where
    T: Unpin

impl<T> UnwindSafe for Endpoints<T> where
    T: UnwindSafe

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: for<'de> 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.