pub struct BlockingSyncClient { /* private fields */ }Expand description
A blocking libp2p sync client — the thin block_on wrapper the module docs promise. It owns a
tokio runtime and a Libp2pSyncNode, pins a single target peer, and exposes blocking
publish_frames/pull_frames over opaque op frames. Keeping the runtime + libp2p types here lets
the client-core SyncTransport adapter stay a plain synchronous caller (and keeps libp2p out of the
wasm-facing crate). A dumb pipe like the async node beneath it: it moves already-signed frames and
validates nothing — all trust stays in the consuming node’s fail-closed inbox.
Implementations§
Source§impl BlockingSyncClient
impl BlockingSyncClient
Sourcepub fn connect(
relay: SyncOpRelay,
peer_id: &str,
peer_addr: &str,
) -> Result<Self, String>
pub fn connect( relay: SyncOpRelay, peer_id: &str, peer_addr: &str, ) -> Result<Self, String>
Connect to a relay/peer: spawn a node on a dedicated multi-threaded runtime (whose worker drives
the event loop continuously), register the peer’s address — the first publish/pull auto-dials
it over noise-encrypted TCP — and serve relay to inbound peers. peer_id is the base58 peer id;
peer_addr is a libp2p multiaddr (e.g. /ip4/127.0.0.1/tcp/4001).
Sourcepub fn local_peer_id(&self) -> PeerId
pub fn local_peer_id(&self) -> PeerId
This node’s own peer id (so a peer can be told how to dial us back).
Auto Trait Implementations§
impl !Freeze for BlockingSyncClient
impl RefUnwindSafe for BlockingSyncClient
impl Send for BlockingSyncClient
impl Sync for BlockingSyncClient
impl Unpin for BlockingSyncClient
impl UnsafeUnpin for BlockingSyncClient
impl UnwindSafe for BlockingSyncClient
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more