Struct nostr_relay::Subscriber
source · pub struct Subscriber {
pub addr: Recipient<SubscribeResult>,
pub events: Vec<(usize, Event)>,
pub subscriptions: HashMap<usize, HashMap<String, Subscription>>,
pub setting: SettingWrapper,
}
Fields§
§addr: Recipient<SubscribeResult>
§events: Vec<(usize, Event)>
§subscriptions: HashMap<usize, HashMap<String, Subscription>>
map session id -> sub id -> subscription
setting: SettingWrapper
Implementations§
source§impl Subscriber
impl Subscriber
pub fn new(addr: Recipient<SubscribeResult>, setting: SettingWrapper) -> Self
Trait Implementations§
source§impl Actor for Subscriber
impl Actor for Subscriber
§type Context = Context<Subscriber>
type Context = Context<Subscriber>
Actor execution context type
source§fn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
source§fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in
Actor::Stopping
state. Read moresource§fn start(self) -> Addr<Self>where
Self: Actor<Context = Context<Self>>,
fn start(self) -> Addr<Self>where Self: Actor<Context = Context<Self>>,
Start a new asynchronous actor, returning its address. Read more
source§impl Handler<Dispatch> for Subscriber
impl Handler<Dispatch> for Subscriber
source§impl Handler<Subscribe> for Subscriber
impl Handler<Subscribe> for Subscriber
§type Result = Subscribed
type Result = Subscribed
The type of value that this handler will return. Read more
source§impl Handler<Unsubscribe> for Subscriber
impl Handler<Unsubscribe> for Subscriber
Auto Trait Implementations§
impl !RefUnwindSafe for Subscriber
impl Send for Subscriber
impl Sync for Subscriber
impl Unpin for Subscriber
impl !UnwindSafe for Subscriber
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.