pub struct Packet {
pub sequence: Sequence,
pub source_port: PortId,
pub source_channel: ChannelId,
pub destination_port: PortId,
pub destination_channel: ChannelId,
pub data: Vec<u8>,
pub timeout_height: TimeoutHeight,
pub timeout_timestamp: Timestamp,
}
Fields
sequence: Sequence
source_port: PortId
source_channel: ChannelId
destination_port: PortId
destination_channel: ChannelId
data: Vec<u8>
timeout_height: TimeoutHeight
timeout_timestamp: Timestamp
Implementations
sourceimpl Packet
impl Packet
sourcepub fn timed_out(
&self,
dst_chain_ts: &Timestamp,
dst_chain_height: Height
) -> bool
pub fn timed_out(
&self,
dst_chain_ts: &Timestamp,
dst_chain_height: Height
) -> bool
Checks whether a packet from a
SendPacket
event is timed-out relative to the current state of the
destination chain.
Checks both for time-out relative to the destination chain’s
current timestamp dst_chain_ts
as well as relative to
the height dst_chain_height
.
Note: a timed-out packet should result in a
MsgTimeout
,
instead of the common-case where it results in
MsgRecvPacket
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Packet
impl<'de> Deserialize<'de> for Packet
sourcefn 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
sourceimpl PartialEq<Packet> for Packet
impl PartialEq<Packet> for Packet
sourceimpl TryFrom<Packet> for Vec<Tag>
impl TryFrom<Packet> for Vec<Tag>
Convert attributes to Tendermint ABCI tags
Note
The parsing of Key
s and Value
s never fails, because the
FromStr
instance of tendermint::abci::tag::{Key, Value}
is infallible, even if it is not represented in the error type.
Once tendermint-rs improves the API of the Key
and Value
types,
we will be able to remove the .parse().unwrap()
calls.
impl Eq for Packet
impl StructuralEq for Packet
impl StructuralPartialEq for Packet
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more