pub struct HttpSyncTransport { /* private fields */ }Expand description
Bounded blocking HTTP client for leader-to-follower sync batches.
Implementations§
Source§impl HttpSyncTransport
impl HttpSyncTransport
Sourcepub fn new(host: impl Into<String>, port: u16) -> Self
pub fn new(host: impl Into<String>, port: u16) -> Self
Creates a plain-HTTP transport for host and port.
Sourcepub fn with_auth_token(self, token: impl Into<String>) -> Self
pub fn with_auth_token(self, token: impl Into<String>) -> Self
Adds a bearer token without exposing it through Debug.
Sourcepub fn with_scheme(self, scheme: SyncPeerScheme) -> Self
pub fn with_scheme(self, scheme: SyncPeerScheme) -> Self
Selects the HTTP or HTTPS transport scheme.
Sourcepub fn with_https(self) -> Self
pub fn with_https(self) -> Self
Selects HTTPS transport.
Sourcepub fn with_timeout_ms(self, timeout_ms: u64) -> Self
pub fn with_timeout_ms(self, timeout_ms: u64) -> Self
Sets connect, read, and write deadlines in milliseconds.
Sourcepub fn with_timeouts(self, timeouts: HttpTimeouts) -> Self
pub fn with_timeouts(self, timeouts: HttpTimeouts) -> Self
Sets independent connect, read and write deadlines.
Sourcepub fn with_max_response_bytes(self, max_response_bytes: usize) -> Self
pub fn with_max_response_bytes(self, max_response_bytes: usize) -> Self
Sets the maximum number of response bytes read from a peer.
Sourcepub fn with_max_request_body_bytes(self, max_request_body_bytes: usize) -> Self
pub fn with_max_request_body_bytes(self, max_request_body_bytes: usize) -> Self
Sets the maximum encoded request-body size.
Sourcepub fn with_source_identity(self, source_identity: CoreIdentity) -> Self
pub fn with_source_identity(self, source_identity: CoreIdentity) -> Self
Uses the identity-aware appcore.sync.v1 envelope for outbound batches.
Sourcepub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
pub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
Replaces the cooperative cancellation token used by transport I/O.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Reports whether cancellation was requested.
Sourcepub fn post_sync_events(&self, message: &SyncMessage) -> SyncResult<()>
pub fn post_sync_events(&self, message: &SyncMessage) -> SyncResult<()>
Posts a batch to /v1/sync/events and requires a 2xx response.
Trait Implementations§
Source§impl Clone for HttpSyncTransport
impl Clone for HttpSyncTransport
Source§fn clone(&self) -> HttpSyncTransport
fn clone(&self) -> HttpSyncTransport
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 moreSource§impl Debug for HttpSyncTransport
impl Debug for HttpSyncTransport
impl Eq for HttpSyncTransport
Auto Trait Implementations§
impl Freeze for HttpSyncTransport
impl RefUnwindSafe for HttpSyncTransport
impl Send for HttpSyncTransport
impl Sync for HttpSyncTransport
impl Unpin for HttpSyncTransport
impl UnsafeUnpin for HttpSyncTransport
impl UnwindSafe for HttpSyncTransport
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