pub struct ViewerClient { /* private fields */ }Implementations§
Source§impl ViewerClient
impl ViewerClient
pub fn new(address: String, signature: Option<String>) -> Self
Sourcepub async fn send(
&self,
path: &str,
body: &Value,
) -> Result<(u16, Value), Error>
pub async fn send( &self, path: &str, body: &Value, ) -> Result<(u16, Value), Error>
POST body as JSON to {address}{path}. path must start
with / (Error::ViewerPathMissingSlash). A non-2xx status
is NOT an error — the response is returned as-is; the body is
parsed as JSON, falling back to Value::String(raw_text).
Trait Implementations§
Source§impl Clone for ViewerClient
impl Clone for ViewerClient
Source§fn clone(&self) -> ViewerClient
fn clone(&self) -> ViewerClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ViewerClient
impl !UnwindSafe for ViewerClient
impl Freeze for ViewerClient
impl Send for ViewerClient
impl Sync for ViewerClient
impl Unpin for ViewerClient
impl UnsafeUnpin for ViewerClient
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more