Struct chik_client::Peer
source · pub struct Peer { /* private fields */ }Implementations§
source§impl Peer
impl Peer
pub fn new(ws: WebSocketStream<MaybeTlsStream<TcpStream>>) -> Self
pub async fn send_handshake( &self, network_id: String, node_type: NodeType ) -> Result<(), Error<()>>
pub async fn request_puzzle_and_solution( &self, coin_id: Bytes32, height: u32 ) -> Result<PuzzleSolutionResponse, Error<RejectPuzzleSolution>>
pub async fn send_transaction( &self, spend_bundle: SpendBundle ) -> Result<TransactionAck, Error<()>>
pub async fn request_block_header( &self, height: u32 ) -> Result<HeaderBlock, Error<RejectHeaderRequest>>
pub async fn request_block_headers( &self, start_height: u32, end_height: u32, return_filter: bool ) -> Result<Vec<HeaderBlock>, Error<()>>
pub async fn request_removals( &self, height: u32, header_hash: Bytes32, coin_ids: Option<Vec<Bytes32>> ) -> Result<RespondRemovals, Error<RejectRemovalsRequest>>
pub async fn request_additions( &self, height: u32, header_hash: Option<Bytes32>, puzzle_hashes: Option<Vec<Bytes32>> ) -> Result<RespondAdditions, Error<RejectAdditionsRequest>>
pub async fn register_for_ph_updates( &self, puzzle_hashes: Vec<Bytes32>, min_height: u32 ) -> Result<Vec<CoinState>, Error<()>>
pub async fn register_for_coin_updates( &self, coin_ids: Vec<Bytes32>, min_height: u32 ) -> Result<Vec<CoinState>, Error<()>>
pub async fn request_children( &self, coin_id: Bytes32 ) -> Result<Vec<CoinState>, Error<()>>
pub async fn request_ses_info( &self, start_height: u32, end_height: u32 ) -> Result<RespondSesInfo, Error<()>>
pub async fn request_fee_estimates( &self, time_targets: Vec<u64> ) -> Result<FeeEstimateGroup, Error<()>>
pub async fn send<T>(&self, body: T) -> Result<(), Error<()>>where
T: Streamable + ChikProtocolMessage,
pub async fn request_or_reject<T, R, B>(&self, body: B) -> Result<T, Error<R>>where
T: Streamable + ChikProtocolMessage,
R: Streamable + ChikProtocolMessage,
B: Streamable + ChikProtocolMessage,
pub async fn request<Response, T>(&self, body: T) -> Result<Response, Error<()>>
pub async fn request_raw<T, R>(&self, body: T) -> Result<Message, Error<R>>where
T: Streamable + ChikProtocolMessage,
pub fn receiver(&self) -> &Receiver<PeerEvent>
pub fn receiver_mut(&mut self) -> &mut Receiver<PeerEvent>
Trait Implementations§
Auto Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more