pub enum ProtocolError {
Show 21 variants
Timeout(Duration),
VersionMismatch(u32, u32),
WrongNetwork(String, String),
UnexpectedMessage(&'static str, Option<KaspadMessagePayloadType>),
ConversionError(ConversionError),
RuleError(RuleError),
PruningImportError(PruningImportError),
ConsensusError(ConsensusError),
MiningManagerError(MiningManagerError),
IdentityError(Error),
Other(&'static str),
OtherOwned(String),
MisbehavingPeer(String),
ConnectionClosed,
IncomingRouteCapacityReached(KaspadMessagePayloadType, String),
OutgoingRouteCapacityReached(String),
NoRouteForMessageType(KaspadMessagePayloadType),
PeerAlreadyExists(PeerKey),
LoopbackConnection(PeerKey),
Rejected(String),
IgnorableReject(String),
}Variants§
Timeout(Duration)
VersionMismatch(u32, u32)
WrongNetwork(String, String)
UnexpectedMessage(&'static str, Option<KaspadMessagePayloadType>)
ConversionError(ConversionError)
RuleError(RuleError)
PruningImportError(PruningImportError)
ConsensusError(ConsensusError)
MiningManagerError(MiningManagerError)
IdentityError(Error)
Other(&'static str)
OtherOwned(String)
MisbehavingPeer(String)
ConnectionClosed
IncomingRouteCapacityReached(KaspadMessagePayloadType, String)
OutgoingRouteCapacityReached(String)
NoRouteForMessageType(KaspadMessagePayloadType)
PeerAlreadyExists(PeerKey)
LoopbackConnection(PeerKey)
Rejected(String)
IgnorableReject(String)
Implementations§
Source§impl ProtocolError
impl ProtocolError
pub fn is_connection_closed_error(&self) -> bool
pub fn can_send_outgoing_message(&self) -> bool
pub fn to_reject_message(&self) -> String
pub fn from_reject_message(reason: String) -> Self
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ConsensusError> for ProtocolError
impl From<ConsensusError> for ProtocolError
Source§fn from(source: ConsensusError) -> Self
fn from(source: ConsensusError) -> Self
Converts to this type from the input type.
Source§impl From<ConversionError> for ProtocolError
impl From<ConversionError> for ProtocolError
Source§fn from(source: ConversionError) -> Self
fn from(source: ConversionError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
Source§impl From<MiningManagerError> for ProtocolError
impl From<MiningManagerError> for ProtocolError
Source§fn from(source: MiningManagerError) -> Self
fn from(source: MiningManagerError) -> Self
Converts to this type from the input type.
Source§impl From<ProtocolError> for ConnectionError
impl From<ProtocolError> for ConnectionError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<PruningImportError> for ProtocolError
impl From<PruningImportError> for ProtocolError
Source§fn from(source: PruningImportError) -> Self
fn from(source: PruningImportError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
Source§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere
T: Any + 'static,
Source§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any, which is backed by the type implementing this trait.Source§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any, which is backed by the type implementing this trait.Source§impl<T> CastFromSync for T
impl<T> CastFromSync for T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request