#[repr(i32)]pub enum State {
UninitializedUnspecified = 0,
Init = 1,
Tryopen = 2,
Open = 3,
}
Expand description
State defines if a connection is in one of the following states: INIT, TRYOPEN, OPEN or UNINITIALIZED.
Variants§
UninitializedUnspecified = 0
Default State
Init = 1
A connection end has just started the opening handshake.
Tryopen = 2
A connection end has acknowledged the handshake step on the counterparty chain.
Open = 3
A connection end has completed the handshake.
Implementations§
source§impl State
impl State
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<State>
pub fn from_str_name(value: &str) -> Option<State>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
source§fn deserialize<D>(
deserializer: D
) -> Result<State, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<State, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for State
impl Ord for State
source§impl PartialEq for State
impl PartialEq for State
source§impl PartialOrd for State
impl PartialOrd for State
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for State
impl Serialize for State
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<i32> for State
impl TryFrom<i32> for State
§type Error = DecodeError
type Error = DecodeError
The type returned in the event of a conversion error.
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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