pub struct BraidClient {
pub network: Arc<NativeNetwork>,
pub config: Arc<ClientConfig>,
pub multiplexers: Arc<Mutex<HashMap<String, Arc<Multiplexer>>>>,
}Expand description
The main Braid HTTP client
Fields§
§network: Arc<NativeNetwork>§config: Arc<ClientConfig>§multiplexers: Arc<Mutex<HashMap<String, Arc<Multiplexer>>>>Active multiplexers by origin.
Implementations§
Source§impl BraidClient
impl BraidClient
pub fn network(&self) -> &Arc<NativeNetwork>
pub fn client(&self) -> &Client
pub fn new() -> Result<Self>
pub fn with_config(config: ClientConfig) -> Result<Self>
pub fn with_client(client: Client) -> Result<Self>
pub async fn get(&self, url: &str) -> Result<BraidResponse>
pub async fn put( &self, url: &str, body: &str, request: BraidRequest, ) -> Result<BraidResponse>
pub async fn post( &self, url: &str, body: &str, request: BraidRequest, ) -> Result<BraidResponse>
pub async fn poke( &self, recipient_endpoint: &str, post_url: &str, ) -> Result<BraidResponse>
pub async fn fetch( &self, url: &str, request: BraidRequest, ) -> Result<BraidResponse>
pub async fn subscribe( &self, url: &str, request: BraidRequest, ) -> Result<Subscription>
pub async fn fetch_multiplexed( &self, url: &str, request: BraidRequest, ) -> Result<BraidResponse>
pub fn config(&self) -> &ClientConfig
Trait Implementations§
Source§impl Clone for BraidClient
impl Clone for BraidClient
Source§fn clone(&self) -> BraidClient
fn clone(&self) -> BraidClient
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for BraidClient
impl !RefUnwindSafe for BraidClient
impl Send for BraidClient
impl Sync for BraidClient
impl Unpin for BraidClient
impl !UnwindSafe for BraidClient
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