pub struct NostrRelay { /* private fields */ }Implementations§
Source§impl NostrRelay
impl NostrRelay
pub fn new( trusted_store: Arc<dyn SocialGraphBackend>, data_dir: PathBuf, public_pubkeys: HashSet<String>, social_graph: Option<Arc<SocialGraphAccessControl>>, config: NostrRelayConfig, ) -> Result<Self>
pub fn next_client_id(&self) -> u64
pub async fn ingest_trusted_event(&self, event: Event) -> Result<()>
pub async fn ingest_trusted_event_from_bluetooth( &self, event: Event, peer_id: Option<String>, ) -> Result<()>
pub async fn ingest_trusted_event_silent(&self, event: Event) -> Result<()>
pub async fn bluetooth_received_events( &self, limit: usize, ) -> Vec<BluetoothReceivedEventRecord>
pub async fn query_events( &self, filter: &NostrFilter, limit: usize, ) -> Vec<Event>
pub async fn register_client( &self, client_id: u64, sender: UnboundedSender<String>, pubkey: Option<String>, )
pub async fn unregister_client(&self, client_id: u64)
pub async fn handle_client_message( &self, client_id: u64, msg: NostrClientMessage, )
pub async fn register_subscription_query( &self, client_id: u64, subscription_id: SubscriptionId, filters: Vec<NostrFilter>, ) -> Result<Vec<Event>, &'static str>
Trait Implementations§
Source§impl MeshEventStore for NostrRelay
impl MeshEventStore for NostrRelay
fn ingest_trusted_event<'life0, 'async_trait>(
&'life0 self,
event: Event,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_events<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 NostrFilter,
limit: usize,
) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl MeshRelayClient for NostrRelay
impl MeshRelayClient for NostrRelay
fn next_client_id(&self) -> u64
fn register_client<'life0, 'async_trait>(
&'life0 self,
client_id: u64,
sender: UnboundedSender<String>,
pubkey: Option<String>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unregister_client<'life0, 'async_trait>(
&'life0 self,
client_id: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_client_message<'life0, 'async_trait>(
&'life0 self,
client_id: u64,
msg: NostrClientMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_subscription_query<'life0, 'async_trait>(
&'life0 self,
client_id: u64,
subscription_id: SubscriptionId,
filters: Vec<NostrFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, &'static str>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ingest_trusted_event_from_peer<'life0, 'async_trait>(
&'life0 self,
event: Event,
peer_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for NostrRelay
impl !RefUnwindSafe for NostrRelay
impl Send for NostrRelay
impl Sync for NostrRelay
impl Unpin for NostrRelay
impl UnsafeUnpin for NostrRelay
impl !UnwindSafe for NostrRelay
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