Struct ibc_core_connection_types::ConnectionEnd
source · pub struct ConnectionEnd {
pub state: State,
/* private fields */
}
Fields§
§state: State
Implementations§
source§impl ConnectionEnd
impl ConnectionEnd
pub fn new( state: State, client_id: ClientId, counterparty: Counterparty, versions: Vec<Version>, delay_period: Duration ) -> Result<Self, ConnectionError>
sourcepub fn set_counterparty(&mut self, new_cparty: Counterparty)
pub fn set_counterparty(&mut self, new_cparty: Counterparty)
Setter for the counterparty
field.
sourcepub fn set_version(&mut self, new_version: Version)
pub fn set_version(&mut self, new_version: Version)
Setter for the version
field.
sourcepub fn counterparty_matches(&self, other: &Counterparty) -> bool
pub fn counterparty_matches(&self, other: &Counterparty) -> bool
Helper function to compare the counterparty of this end with another counterparty.
sourcepub fn client_id_matches(&self, other: &ClientId) -> bool
pub fn client_id_matches(&self, other: &ClientId) -> bool
Helper function to compare the client id of this end with another client identifier.
sourcepub fn is_uninitialized(&self) -> bool
pub fn is_uninitialized(&self) -> bool
Helper function to determine whether the connection is uninitialized.
sourcepub fn verify_state_matches(
&self,
expected: &State
) -> Result<(), ConnectionError>
pub fn verify_state_matches( &self, expected: &State ) -> Result<(), ConnectionError>
Checks if the state of this connection end matches with an expected state.
sourcepub fn client_id(&self) -> &ClientId
pub fn client_id(&self) -> &ClientId
Getter for the client id on the local party of this connection end.
sourcepub fn counterparty(&self) -> &Counterparty
pub fn counterparty(&self) -> &Counterparty
Getter for the counterparty.
sourcepub fn delay_period(&self) -> Duration
pub fn delay_period(&self) -> Duration
Getter for the delay_period field. This represents the duration, at minimum, to delay the sending of a packet after the client update for that packet has been submitted.
Trait Implementations§
source§impl BorshDeserialize for ConnectionEnd
impl BorshDeserialize for ConnectionEnd
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for ConnectionEnd
impl BorshSerialize for ConnectionEnd
source§impl Clone for ConnectionEnd
impl Clone for ConnectionEnd
source§fn clone(&self) -> ConnectionEnd
fn clone(&self) -> ConnectionEnd
Returns a copy of the value. Read more
1.0.0 · 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 ConnectionEnd
impl Debug for ConnectionEnd
source§impl Decode for ConnectionEnd
impl Decode for ConnectionEnd
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from input.
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl<'de> Deserialize<'de> for ConnectionEnd
impl<'de> Deserialize<'de> for ConnectionEnd
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for ConnectionEnd
impl Encode for ConnectionEnd
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl From<ConnectionEnd> for ConnectionEnd
impl From<ConnectionEnd> for ConnectionEnd
source§fn from(value: ConnectionEnd) -> Self
fn from(value: ConnectionEnd) -> Self
Converts to this type from the input type.
source§impl Hash for ConnectionEnd
impl Hash for ConnectionEnd
source§impl JsonSchema for ConnectionEnd
impl JsonSchema for ConnectionEnd
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq for ConnectionEnd
impl PartialEq for ConnectionEnd
source§fn eq(&self, other: &ConnectionEnd) -> bool
fn eq(&self, other: &ConnectionEnd) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Protobuf<ConnectionEnd> for ConnectionEnd
impl Protobuf<ConnectionEnd> for ConnectionEnd
source§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode into a buffer in Protobuf format. Read more
source§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode with a length-delimiter to a buffer in Protobuf format. Read more
source§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode an instance from a buffer. Read more
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
source§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
source§fn encode_vec(self) -> Vec<u8>
fn encode_vec(self) -> Vec<u8>
Encodes into a Protobuf-encoded
Vec<u8>
.source§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8>
(or equivalent).source§fn encode_length_delimited_vec(self) -> Vec<u8>
fn encode_length_delimited_vec(self) -> Vec<u8>
Encode with a length-delimiter to a
Vec<u8>
Protobuf-encoded message.source§impl Serialize for ConnectionEnd
impl Serialize for ConnectionEnd
source§impl TryFrom<ConnectionEnd> for ConnectionEnd
impl TryFrom<ConnectionEnd> for ConnectionEnd
§type Error = ConnectionError
type Error = ConnectionError
The type returned in the event of a conversion error.
source§impl TypeInfo for ConnectionEnd
impl TypeInfo for ConnectionEnd
impl EncodeLike for ConnectionEnd
impl Eq for ConnectionEnd
impl StructuralPartialEq for ConnectionEnd
Auto Trait Implementations§
impl Freeze for ConnectionEnd
impl RefUnwindSafe for ConnectionEnd
impl Send for ConnectionEnd
impl Sync for ConnectionEnd
impl Unpin for ConnectionEnd
impl UnwindSafe for ConnectionEnd
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