Struct ibc_relayer::connection::Connection
source · [−]pub struct Connection<ChainA: ChainHandle, ChainB: ChainHandle> {
pub delay_period: Duration,
pub a_side: ConnectionSide<ChainA>,
pub b_side: ConnectionSide<ChainB>,
}Fields
delay_period: Durationa_side: ConnectionSide<ChainA>b_side: ConnectionSide<ChainB>Implementations
sourceimpl<ChainA: ChainHandle, ChainB: ChainHandle> Connection<ChainA, ChainB>
impl<ChainA: ChainHandle, ChainB: ChainHandle> Connection<ChainA, ChainB>
sourcepub fn new(
b_to_a_client: ForeignClient<ChainA, ChainB>,
a_to_b_client: ForeignClient<ChainB, ChainA>,
delay_period: Duration
) -> Result<Self, ConnectionError>
pub fn new(
b_to_a_client: ForeignClient<ChainA, ChainB>,
a_to_b_client: ForeignClient<ChainB, ChainA>,
delay_period: Duration
) -> Result<Self, ConnectionError>
Create a new connection, ensuring that the handshake has succeeded and the two connection ends exist on each side.
pub fn restore_from_event(
chain: ChainA,
counterparty_chain: ChainB,
connection_open_event: IbcEvent
) -> Result<Connection<ChainA, ChainB>, ConnectionError>
sourcepub fn restore_from_state(
chain: ChainA,
counterparty_chain: ChainB,
connection: WorkerConnectionObject,
height: Height
) -> Result<(Connection<ChainA, ChainB>, State), ConnectionError>
pub fn restore_from_state(
chain: ChainA,
counterparty_chain: ChainB,
connection: WorkerConnectionObject,
height: Height
) -> Result<(Connection<ChainA, ChainB>, State), ConnectionError>
Recreates a ‘Connection’ object from the worker’s object built from chain state scanning. The connection must exist on chain.
pub fn find(
a_client: ForeignClient<ChainA, ChainB>,
b_client: ForeignClient<ChainB, ChainA>,
conn_end_a: &IdentifiedConnectionEnd
) -> Result<Connection<ChainA, ChainB>, ConnectionError>
pub fn src_chain(&self) -> ChainA
pub fn dst_chain(&self) -> ChainB
pub fn src_client_id(&self) -> &ClientId
pub fn dst_client_id(&self) -> &ClientId
pub fn src_connection_id(&self) -> Option<&ConnectionId>
pub fn dst_connection_id(&self) -> Option<&ConnectionId>
pub fn flipped(&self) -> Connection<ChainB, ChainA>
pub fn counterparty_state(&self) -> Result<State, ConnectionError>
pub fn handshake_step(
&mut self,
state: State
) -> Result<(Option<IbcEvent>, Next), ConnectionError>
pub fn step_state(&mut self, state: State, index: u64) -> RetryResult<Next, u64>
pub fn step_event(
&mut self,
event: IbcEvent,
index: u64
) -> RetryResult<Next, u64>
pub fn build_update_client_on_src(
&self,
height: Height
) -> Result<Vec<Any>, ConnectionError>
pub fn build_update_client_on_dst(
&self,
height: Height
) -> Result<Vec<Any>, ConnectionError>
pub fn build_conn_init(&self) -> Result<Vec<Any>, ConnectionError>
pub fn build_conn_init_and_send(&self) -> Result<IbcEvent, ConnectionError>
sourcepub fn build_conn_try(&self) -> Result<Vec<Any>, ConnectionError>
pub fn build_conn_try(&self) -> Result<Vec<Any>, ConnectionError>
Attempts to build a MsgConnOpenTry.
pub fn build_conn_try_and_send(&self) -> Result<IbcEvent, ConnectionError>
sourcepub fn build_conn_ack(&self) -> Result<Vec<Any>, ConnectionError>
pub fn build_conn_ack(&self) -> Result<Vec<Any>, ConnectionError>
Attempts to build a MsgConnOpenAck.
pub fn build_conn_ack_and_send(&self) -> Result<IbcEvent, ConnectionError>
sourcepub fn build_conn_confirm(&self) -> Result<Vec<Any>, ConnectionError>
pub fn build_conn_confirm(&self) -> Result<Vec<Any>, ConnectionError>
Attempts to build a MsgConnOpenConfirm.
pub fn build_conn_confirm_and_send(&self) -> Result<IbcEvent, ConnectionError>
pub fn map_chain<ChainC: ChainHandle, ChainD: ChainHandle>(
self,
mapper_a: impl Fn(ChainA) -> ChainC,
mapper_b: impl Fn(ChainB) -> ChainD
) -> Connection<ChainC, ChainD>
Trait Implementations
sourceimpl<ChainA: Clone + ChainHandle, ChainB: Clone + ChainHandle> Clone for Connection<ChainA, ChainB>
impl<ChainA: Clone + ChainHandle, ChainB: Clone + ChainHandle> Clone for Connection<ChainA, ChainB>
sourcefn clone(&self) -> Connection<ChainA, ChainB>
fn clone(&self) -> Connection<ChainA, ChainB>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<ChainA: Debug + ChainHandle, ChainB: Debug + ChainHandle> Debug for Connection<ChainA, ChainB>
impl<ChainA: Debug + ChainHandle, ChainB: Debug + ChainHandle> Debug for Connection<ChainA, ChainB>
sourceimpl<ChainA: ChainHandle, ChainB: ChainHandle> Serialize for Connection<ChainA, ChainB> where
ChainA: Serialize,
ChainB: Serialize,
impl<ChainA: ChainHandle, ChainB: ChainHandle> Serialize for Connection<ChainA, ChainB> where
ChainA: Serialize,
ChainB: Serialize,
Auto Trait Implementations
impl<ChainA, ChainB> RefUnwindSafe for Connection<ChainA, ChainB> where
ChainA: RefUnwindSafe,
ChainB: RefUnwindSafe,
impl<ChainA, ChainB> Send for Connection<ChainA, ChainB>
impl<ChainA, ChainB> Sync for Connection<ChainA, ChainB>
impl<ChainA, ChainB> Unpin for Connection<ChainA, ChainB> where
ChainA: Unpin,
ChainB: Unpin,
impl<ChainA, ChainB> UnwindSafe for Connection<ChainA, ChainB> where
ChainA: UnwindSafe,
ChainB: UnwindSafe,
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
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T in a tonic::Request
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
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