pub struct HttpExec { /* private fields */ }Expand description
A server origin plus the decision whether it serves the Matrix paths under /_matrix.
Implementations§
Source§impl HttpExec
impl HttpExec
pub fn new(base: &str) -> Result<Self>
Sourcepub fn probe_prefix(&mut self) -> bool
pub fn probe_prefix(&mut self) -> bool
Our own mounts serve /client/v3 without the spec prefix. Anything else is asked, never
assumed: GET /_matrix/client/versions answering 2xx means the prefix is served.
pub fn set_keep_prefix(&mut self, keep: bool)
pub fn keep_prefix(&self) -> bool
pub fn base(&self) -> &Url
pub fn client(&self) -> &Client
Sourcepub fn rebase(&mut self, origin: &str) -> Result<()>
pub fn rebase(&mut self, origin: &str) -> Result<()>
Replaces the origin (.well-known told us the real one).
Sourcepub fn get_json(&self, path: &str) -> Result<(u16, Value)>
pub fn get_json(&self, path: &str) -> Result<(u16, Value)>
GET path as JSON (no bearer): (status, json).
Sourcepub fn get_json_as(&self, bearer: &str, path: &str) -> Result<(u16, Value)>
pub fn get_json_as(&self, bearer: &str, path: &str) -> Result<(u16, Value)>
GET path as JSON with a bearer: (status, json).
Sourcepub fn url(&self, path: &str, query: &[(String, String)]) -> Result<Url>
pub fn url(&self, path: &str, query: &[(String, String)]) -> Result<Url>
/_matrix/client/v3/x becomes /client/v3/x unless the server serves the prefix. A path
already without it is left alone.
Sourcepub fn perform(
&self,
bearer: &str,
request: &OutgoingRequest,
) -> Result<HttpResponseDescriptor>
pub fn perform( &self, bearer: &str, request: &OutgoingRequest, ) -> Result<HttpResponseDescriptor>
One engine request with bearer.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HttpExec
impl !UnwindSafe for HttpExec
impl Freeze for HttpExec
impl Send for HttpExec
impl Sync for HttpExec
impl Unpin for HttpExec
impl UnsafeUnpin for HttpExec
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