pub struct BluetoothPeer {
pub peer_id: PeerId,
pub direction: PeerDirection,
pub created_at: Instant,
pub connected_at: Option<Instant>,
/* private fields */
}Fields§
§peer_id: PeerId§direction: PeerDirection§created_at: Instant§connected_at: Option<Instant>Implementations§
Source§impl BluetoothPeer
impl BluetoothPeer
pub fn new( peer_id: PeerId, direction: PeerDirection, link: Arc<dyn BluetoothLink>, store: Option<Arc<dyn ContentStore>>, nostr_relay: Option<Arc<NostrRelay>>, mesh_frame_tx: Option<Sender<(PeerId, MeshNostrFrame)>>, traffic_state: Option<Arc<WebRTCState>>, ) -> Arc<Self>
pub fn is_connected(&self) -> bool
pub fn htl_config(&self) -> &PeerHTLConfig
pub async fn request_with_timeout( &self, hash_hex: &str, timeout: Duration, ) -> Result<Option<Vec<u8>>>
pub async fn query_nostr_events( &self, filters: Vec<NostrFilter>, timeout: Duration, ) -> Result<Vec<Event>>
pub async fn send_mesh_frame_text(&self, frame: &MeshNostrFrame) -> Result<()>
pub async fn close(&self) -> Result<()>
Auto Trait Implementations§
impl Freeze for BluetoothPeer
impl !RefUnwindSafe for BluetoothPeer
impl Send for BluetoothPeer
impl Sync for BluetoothPeer
impl Unpin for BluetoothPeer
impl UnsafeUnpin for BluetoothPeer
impl !UnwindSafe for BluetoothPeer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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