pub struct HttpSyncTransport { /* private fields */ }Available on crate features
sync and sync-http only.Expand description
HTTP-based sync transport using reqwest.
Communicates with a remote PulseDB sync server over HTTP using bincode-serialized request/response bodies.
§Endpoints
| Method | Path | Request | Response |
|---|---|---|---|
| POST | /sync/handshake | HandshakeRequest | HandshakeResponse |
| POST | /sync/push | Vec<SyncChange> | PushResponse |
| POST | /sync/pull | PullRequest | PullResponse |
| GET | /sync/health | (none) | 200 OK |
Implementations§
Trait Implementations§
Source§impl SyncTransport for HttpSyncTransport
impl SyncTransport for HttpSyncTransport
Source§fn handshake<'life0, 'async_trait>(
&'life0 self,
request: HandshakeRequest,
) -> Pin<Box<dyn Future<Output = Result<HandshakeResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handshake<'life0, 'async_trait>(
&'life0 self,
request: HandshakeRequest,
) -> Pin<Box<dyn Future<Output = Result<HandshakeResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a handshake with the remote peer. Read more
Source§fn push_changes<'life0, 'async_trait>(
&'life0 self,
changes: Vec<SyncChange>,
) -> Pin<Box<dyn Future<Output = Result<PushResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn push_changes<'life0, 'async_trait>(
&'life0 self,
changes: Vec<SyncChange>,
) -> Pin<Box<dyn Future<Output = Result<PushResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Push local changes to the remote peer. Read more
Source§fn pull_changes<'life0, 'async_trait>(
&'life0 self,
request: PullRequest,
) -> Pin<Box<dyn Future<Output = Result<PullResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pull_changes<'life0, 'async_trait>(
&'life0 self,
request: PullRequest,
) -> Pin<Box<dyn Future<Output = Result<PullResponse, SyncError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Pull changes from the remote peer. Read more
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more