pub enum SyncError {
Transport(String),
Handshake(String),
Serialization(String),
Timeout,
ConnectionLost,
ProtocolVersion {
local: u32,
remote: u32,
},
InvalidPayload(String),
CursorNotFound {
instance: InstanceId,
},
Shutdown,
}sync only.Expand description
Errors specific to the sync protocol.
These are wrapped into crate::PulseDBError::Sync when propagated
through the public API.
Variants§
Transport(String)
Transport-level failure (network I/O, connection refused, etc.).
Handshake(String)
Handshake was rejected by the remote peer.
Serialization(String)
Failed to serialize or deserialize a sync message.
Timeout
Operation timed out waiting for a response.
ConnectionLost
Connection to the remote peer was lost.
ProtocolVersion
Protocol version mismatch between peers.
InvalidPayload(String)
Received an invalid or unrecognized payload.
CursorNotFound
No cursor found for the specified peer instance.
Fields
instance: InstanceIdThe peer instance whose cursor was not found.
Shutdown
The sync system is shutting down.
Implementations§
Source§impl SyncError
impl SyncError
Sourcepub fn transport(msg: impl Into<String>) -> Self
pub fn transport(msg: impl Into<String>) -> Self
Creates a transport error with the given message.
Sourcepub fn handshake(msg: impl Into<String>) -> Self
pub fn handshake(msg: impl Into<String>) -> Self
Creates a handshake error with the given message.
Sourcepub fn serialization(msg: impl Into<String>) -> Self
pub fn serialization(msg: impl Into<String>) -> Self
Creates a serialization error with the given message.
Sourcepub fn invalid_payload(msg: impl Into<String>) -> Self
pub fn invalid_payload(msg: impl Into<String>) -> Self
Creates an invalid payload error with the given message.
Sourcepub fn is_transport(&self) -> bool
pub fn is_transport(&self) -> bool
Returns true if this is a transport error.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if this is a timeout error.
Sourcepub fn is_connection_lost(&self) -> bool
pub fn is_connection_lost(&self) -> bool
Returns true if this is a connection lost error.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if this is a shutdown error.
Trait Implementations§
Source§impl Error for SyncError
impl Error for SyncError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SyncError
impl RefUnwindSafe for SyncError
impl Send for SyncError
impl Sync for SyncError
impl Unpin for SyncError
impl UnsafeUnpin for SyncError
impl UnwindSafe for SyncError
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.