pub struct Client<Number, Hash, Header, SignedBlock> { /* private fields */ }
Expand description
The Client.
Implementations
sourceimpl<Number, Hash, Header, SignedBlock> Client<Number, Hash, Header, SignedBlock> where
Number: 'static + Send + Sync,
Hash: 'static + Send + Sync + DeserializeOwned + Serialize,
Header: 'static + Send + Sync + DeserializeOwned,
SignedBlock: 'static + Send + Sync + DeserializeOwned,
impl<Number, Hash, Header, SignedBlock> Client<Number, Hash, Header, SignedBlock> where
Number: 'static + Send + Sync,
Hash: 'static + Send + Sync + DeserializeOwned + Serialize,
Header: 'static + Send + Sync + DeserializeOwned,
SignedBlock: 'static + Send + Sync + DeserializeOwned,
sourcepub fn new(sender: RpcChannel) -> Client<Number, Hash, Header, SignedBlock>
pub fn new(sender: RpcChannel) -> Client<Number, Hash, Header, SignedBlock>
Creates a new Client
.
sourcepub fn header(
&self,
hash: Option<Hash>
) -> impl Future<Item = Option<Header>, Error = RpcError>
pub fn header(
&self,
hash: Option<Hash>
) -> impl Future<Item = Option<Header>, Error = RpcError>
Get header of a relay chain block.
sourcepub fn block(
&self,
hash: Option<Hash>
) -> impl Future<Item = Option<SignedBlock>, Error = RpcError>
pub fn block(
&self,
hash: Option<Hash>
) -> impl Future<Item = Option<SignedBlock>, Error = RpcError>
Get header and body of a relay chain block.
sourcepub fn block_hash(
&self,
hash: Option<ListOrValue<NumberOrHex>>
) -> impl Future<Item = ListOrValue<Option<Hash>>, Error = RpcError>
pub fn block_hash(
&self,
hash: Option<ListOrValue<NumberOrHex>>
) -> impl Future<Item = ListOrValue<Option<Hash>>, Error = RpcError>
Get hash of the n-th block in the canon chain.
By default returns latest block hash.
sourcepub fn finalized_head(&self) -> impl Future<Item = Hash, Error = RpcError>
pub fn finalized_head(&self) -> impl Future<Item = Hash, Error = RpcError>
Get hash of the last finalized block in the canon chain.
sourcepub fn subscribe_all_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
pub fn subscribe_all_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
All head subscription
sourcepub fn subscribe_finalized_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
pub fn subscribe_finalized_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
Finalized head subscription
sourcepub fn subscribe_new_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
pub fn subscribe_new_heads(
&self
) -> impl Future<Item = TypedSubscriptionStream<Header>, Error = RpcError>
New head subscription
Trait Implementations
sourceimpl<Number, Hash, Header, SignedBlock> Clone for Client<Number, Hash, Header, SignedBlock> where
Number: Clone,
Hash: Clone,
Header: Clone,
SignedBlock: Clone,
impl<Number, Hash, Header, SignedBlock> Clone for Client<Number, Hash, Header, SignedBlock> where
Number: Clone,
Hash: Clone,
Header: Clone,
SignedBlock: Clone,
sourceimpl<Number, Hash, Header, SignedBlock> From<RpcChannel> for Client<Number, Hash, Header, SignedBlock> where
Number: 'static + Send + Sync,
Hash: 'static + Send + Sync + DeserializeOwned + Serialize,
Header: 'static + Send + Sync + DeserializeOwned,
SignedBlock: 'static + Send + Sync + DeserializeOwned,
impl<Number, Hash, Header, SignedBlock> From<RpcChannel> for Client<Number, Hash, Header, SignedBlock> where
Number: 'static + Send + Sync,
Hash: 'static + Send + Sync + DeserializeOwned + Serialize,
Header: 'static + Send + Sync + DeserializeOwned,
SignedBlock: 'static + Send + Sync + DeserializeOwned,
sourcepub fn from(channel: RpcChannel) -> Client<Number, Hash, Header, SignedBlock>
pub fn from(channel: RpcChannel) -> Client<Number, Hash, Header, SignedBlock>
Performs the conversion.
Auto Trait Implementations
impl<Number, Hash, Header, SignedBlock> !RefUnwindSafe for Client<Number, Hash, Header, SignedBlock>
impl<Number, Hash, Header, SignedBlock> Send for Client<Number, Hash, Header, SignedBlock> where
Hash: Send,
Header: Send,
Number: Send,
SignedBlock: Send,
impl<Number, Hash, Header, SignedBlock> Sync for Client<Number, Hash, Header, SignedBlock> where
Hash: Sync,
Header: Sync,
Number: Sync,
SignedBlock: Sync,
impl<Number, Hash, Header, SignedBlock> Unpin for Client<Number, Hash, Header, SignedBlock> where
Hash: Unpin,
Header: Unpin,
Number: Unpin,
SignedBlock: Unpin,
impl<Number, Hash, Header, SignedBlock> !UnwindSafe for Client<Number, Hash, Header, SignedBlock>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. 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>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<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>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcepub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcepub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
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