Struct notedealer::remote::RemoteAccessor
source · [−]pub struct RemoteAccessor {
http_client: Client,
}Expand description
Wrapper around a HTTP Client for sending and receiving ActivityPub-shaped JSON.
Fields
http_client: ClientImplementations
sourceimpl RemoteAccessor
impl RemoteAccessor
sourcepub async fn dereference_ap_object(
&self,
id: &str
) -> Result<Option<Object<'_>>, RemoteAccessError>
pub async fn dereference_ap_object(
&self,
id: &str
) -> Result<Option<Object<'_>>, RemoteAccessError>
Attempt to fetch the ActivityPub object with the given id. ActivityPub id’s are URLs, so this just sends a GET request to the id.
sourcepub async fn send_ap_object(
&self,
inbox: &str,
object: &Object<'_>
) -> Result<(), RemoteAccessError>
pub async fn send_ap_object(
&self,
inbox: &str,
object: &Object<'_>
) -> Result<(), RemoteAccessError>
Attempt to send the ActivityPub object to the given inbox. This serializes the object and POSTs it to the inbox URL.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RemoteAccessor
impl !Send for RemoteAccessor
impl !Sync for RemoteAccessor
impl Unpin for RemoteAccessor
impl !UnwindSafe for RemoteAccessor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more