pub struct BridgeClient { /* private fields */ }Expand description
A client bound to one running bridge’s control plane.
Implementations§
Source§impl BridgeClient
impl BridgeClient
Sourcepub fn new(control_port: u16, token: String) -> Self
pub fn new(control_port: u16, token: String) -> Self
Builds a client targeting the control plane on control_port, using
token for bearer auth.
Sourcepub fn request_builder(&self, payload: &ControlRequest) -> RequestBuilder
pub fn request_builder(&self, payload: &ControlRequest) -> RequestBuilder
Builds the authenticated POST /__bridge/request request for payload,
without sending it. Callers that need the raw streamed response (e.g. the
request --stream path) drive this builder themselves.
Sourcepub async fn send(&self, payload: &ControlRequest) -> Result<ResponseEnvelope>
pub async fn send(&self, payload: &ControlRequest) -> Result<ResponseEnvelope>
Sends a buffered request and returns the parsed response envelope.
Errors when the bridge is unreachable, returns a non-success status, or
returns a body that is not a ResponseEnvelope.
Auto Trait Implementations§
impl !RefUnwindSafe for BridgeClient
impl !UnwindSafe for BridgeClient
impl Freeze for BridgeClient
impl Send for BridgeClient
impl Sync for BridgeClient
impl Unpin for BridgeClient
impl UnsafeUnpin for BridgeClient
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