pub struct Client { /* private fields */ }Expand description
Top-level Bee API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(url: &str) -> Result<Self, Error>
pub fn new(url: &str) -> Result<Self, Error>
Construct a client from a base URL (e.g. "http://localhost:1633").
A trailing slash is appended if missing so relative paths resolve
correctly.
Sourcepub fn with_http_client(url: &str, http: Client) -> Result<Self, Error>
pub fn with_http_client(url: &str, http: Client) -> Result<Self, Error>
Construct a client with a caller-provided reqwest::Client.
Use this to share a connection pool with other code or to set
custom timeouts / TLS roots.
Sourcepub fn file(&self) -> FileApi
pub fn file(&self) -> FileApi
Sub-service: file / data / chunk / SOC / feed / collection uploads and downloads.
Sourcepub fn postage(&self) -> PostageApi
pub fn postage(&self) -> PostageApi
Sub-service: postage batch CRUD + stamp metadata. Stamp math
helpers live as free functions in crate::postage.
Sourcepub fn debug(&self) -> DebugApi
pub fn debug(&self) -> DebugApi
Sub-service: debug / operator endpoints (health, versions, peers, accounting, chequebook, stake).
Sourcepub fn api(&self) -> ApiService
pub fn api(&self) -> ApiService
Sub-service: generic /api/* endpoints (pin, tag, stewardship,
grantee, envelope).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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