Struct chik_client::Peer

source ·
pub struct Peer { /* private fields */ }

Implementations§

source§

impl Peer

source

pub fn new(ws: WebSocketStream<MaybeTlsStream<TcpStream>>) -> Self

source

pub async fn send_handshake( &self, network_id: String, node_type: NodeType, ) -> Result<(), Error<()>>

source

pub async fn request_puzzle_and_solution( &self, coin_id: Bytes32, height: u32, ) -> Result<PuzzleSolutionResponse, Error<RejectPuzzleSolution>>

source

pub async fn send_transaction( &self, spend_bundle: SpendBundle, ) -> Result<TransactionAck, Error<()>>

source

pub async fn request_block_header( &self, height: u32, ) -> Result<HeaderBlock, Error<RejectHeaderRequest>>

source

pub async fn request_block_headers( &self, start_height: u32, end_height: u32, return_filter: bool, ) -> Result<Vec<HeaderBlock>, Error<()>>

source

pub async fn request_removals( &self, height: u32, header_hash: Bytes32, coin_ids: Option<Vec<Bytes32>>, ) -> Result<RespondRemovals, Error<RejectRemovalsRequest>>

source

pub async fn request_additions( &self, height: u32, header_hash: Option<Bytes32>, puzzle_hashes: Option<Vec<Bytes32>>, ) -> Result<RespondAdditions, Error<RejectAdditionsRequest>>

source

pub async fn register_for_ph_updates( &self, puzzle_hashes: Vec<Bytes32>, min_height: u32, ) -> Result<Vec<CoinState>, Error<()>>

source

pub async fn register_for_coin_updates( &self, coin_ids: Vec<Bytes32>, min_height: u32, ) -> Result<Vec<CoinState>, Error<()>>

source

pub async fn request_children( &self, coin_id: Bytes32, ) -> Result<Vec<CoinState>, Error<()>>

source

pub async fn request_ses_info( &self, start_height: u32, end_height: u32, ) -> Result<RespondSesInfo, Error<()>>

source

pub async fn request_fee_estimates( &self, time_targets: Vec<u64>, ) -> Result<FeeEstimateGroup, Error<()>>

source

pub async fn send<T>(&self, body: T) -> Result<(), Error<()>>

source

pub async fn request_or_reject<T, R, B>(&self, body: B) -> Result<T, Error<R>>

source

pub async fn request<Response, T>(&self, body: T) -> Result<Response, Error<()>>

source

pub async fn request_raw<T, R>(&self, body: T) -> Result<Message, Error<R>>

source

pub fn receiver(&self) -> &Receiver<PeerEvent>

source

pub fn receiver_mut(&mut self) -> &mut Receiver<PeerEvent>

Trait Implementations§

source§

impl Drop for Peer

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !Freeze for Peer

§

impl !RefUnwindSafe for Peer

§

impl Send for Peer

§

impl Sync for Peer

§

impl Unpin for Peer

§

impl !UnwindSafe for Peer

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V