pub trait QueryContext: ProvableContext + ValidationContext {
// Required methods
fn client_states(
&self,
) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>;
fn consensus_states(
&self,
client_id: &ClientId,
) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>;
fn consensus_state_heights(
&self,
client_id: &ClientId,
) -> Result<Vec<Height>, HostError>;
fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>;
fn client_connection_ends(
&self,
client_id: &ClientId,
) -> Result<Vec<ConnectionId>, HostError>;
fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>;
fn packet_commitments(
&self,
channel_end_path: &ChannelEndPath,
) -> Result<Vec<PacketState>, HostError>;
fn packet_acknowledgements(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<PacketState>, HostError>;
fn unreceived_packets(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<Sequence>, HostError>;
fn unreceived_acks(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<Sequence>, HostError>;
}
Expand description
Context to be implemented by the host that provides gRPC query services.
Required Methods§
Sourcefn client_states(
&self,
) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>
fn client_states( &self, ) -> Result<Vec<(ClientId, ClientStateRef<Self>)>, HostError>
Returns the list of all clients.
Sourcefn consensus_states(
&self,
client_id: &ClientId,
) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>
fn consensus_states( &self, client_id: &ClientId, ) -> Result<Vec<(Height, ConsensusStateRef<Self>)>, HostError>
Returns the list of all consensus states for the given client.
Sourcefn consensus_state_heights(
&self,
client_id: &ClientId,
) -> Result<Vec<Height>, HostError>
fn consensus_state_heights( &self, client_id: &ClientId, ) -> Result<Vec<Height>, HostError>
Returns the list of all heights at which consensus states for the given client are.
Sourcefn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>
fn connection_ends(&self) -> Result<Vec<IdentifiedConnectionEnd>, HostError>
Returns the list of all connection ends.
Sourcefn client_connection_ends(
&self,
client_id: &ClientId,
) -> Result<Vec<ConnectionId>, HostError>
fn client_connection_ends( &self, client_id: &ClientId, ) -> Result<Vec<ConnectionId>, HostError>
Returns the list of all connection ids of the given client.
Sourcefn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>
fn channel_ends(&self) -> Result<Vec<IdentifiedChannelEnd>, HostError>
Returns the list of all channel ends.
Sourcefn packet_commitments(
&self,
channel_end_path: &ChannelEndPath,
) -> Result<Vec<PacketState>, HostError>
fn packet_commitments( &self, channel_end_path: &ChannelEndPath, ) -> Result<Vec<PacketState>, HostError>
Returns the list of all packet commitments for the given channel end.
Sourcefn packet_acknowledgements(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<PacketState>, HostError>
fn packet_acknowledgements( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<PacketState>, HostError>
Filters the list of packet sequences for the given channel end that are acknowledged.
Returns all the packet acknowledgements if sequences
is empty.
Sourcefn unreceived_packets(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<Sequence>, HostError>
fn unreceived_packets( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<Sequence>, HostError>
Filters the packet sequences for the given channel end that are not received.
Sourcefn unreceived_acks(
&self,
channel_end_path: &ChannelEndPath,
sequences: impl ExactSizeIterator<Item = Sequence>,
) -> Result<Vec<Sequence>, HostError>
fn unreceived_acks( &self, channel_end_path: &ChannelEndPath, sequences: impl ExactSizeIterator<Item = Sequence>, ) -> Result<Vec<Sequence>, HostError>
Filters the list of packet sequences for the given channel end whose acknowledgement is not received.
Returns all the unreceived acknowledgements if sequences
is empty.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.