pub trait SubscriptionManager<S> {
Show 17 methods
fn subscribe_message(
&mut self,
subject: SubjectId,
subscription: S
) -> Result<(), OutOfMemoryError>;
fn unsubscribe_message(&mut self, subject: SubjectId) -> Option<S>;
fn subscribe_request(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>;
fn unsubscribe_request(&mut self, service: ServiceId) -> Option<S>;
fn subscribe_response(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>;
fn unsubscribe_response(&mut self, service: ServiceId) -> Option<S>;
fn find_message_subscription(&self, subject: SubjectId) -> Option<&S>;
fn find_message_subscription_mut(
&mut self,
subject: SubjectId
) -> Option<&mut S>;
fn find_request_subscription(&self, service: ServiceId) -> Option<&S>;
fn find_request_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>;
fn find_response_subscription(&self, service: ServiceId) -> Option<&S>;
fn find_response_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>;
fn for_each_message_subscription_mut<F>(&mut self, operation: F)
where
F: FnMut(&mut S);
fn for_each_request_subscription_mut<F>(&mut self, operation: F)
where
F: FnMut(&mut S);
fn for_each_response_subscription_mut<F>(&mut self, operation: F)
where
F: FnMut(&mut S);
fn find_subscription<I, T: Transport>(
&self,
header: &Header<I, T>
) -> Option<&S> { ... }
fn find_subscription_mut<I, T: Transport>(
&mut self,
header: &Header<I, T>
) -> Option<&mut S> { ... }
}
Expand description
Something that can keep track of active subscriptions
Required methods
fn subscribe_message(
&mut self,
subject: SubjectId,
subscription: S
) -> Result<(), OutOfMemoryError>
fn subscribe_message(
&mut self,
subject: SubjectId,
subscription: S
) -> Result<(), OutOfMemoryError>
Stores a message subscription
fn unsubscribe_message(&mut self, subject: SubjectId) -> Option<S>
fn unsubscribe_message(&mut self, subject: SubjectId) -> Option<S>
Removes and returns a message subscription
fn subscribe_request(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>
fn subscribe_request(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>
Stores a service request subscription
fn unsubscribe_request(&mut self, service: ServiceId) -> Option<S>
fn unsubscribe_request(&mut self, service: ServiceId) -> Option<S>
Removes and returns a service request subscription
fn subscribe_response(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>
fn subscribe_response(
&mut self,
service: ServiceId,
subscription: S
) -> Result<(), OutOfMemoryError>
Stores a service response subscription
fn unsubscribe_response(&mut self, service: ServiceId) -> Option<S>
fn unsubscribe_response(&mut self, service: ServiceId) -> Option<S>
Removes and returns a service response subscription
fn find_message_subscription(&self, subject: SubjectId) -> Option<&S>
fn find_message_subscription(&self, subject: SubjectId) -> Option<&S>
Returns a reference to the message subscription matching the provided subject
fn find_message_subscription_mut(
&mut self,
subject: SubjectId
) -> Option<&mut S>
fn find_message_subscription_mut(
&mut self,
subject: SubjectId
) -> Option<&mut S>
Returns a mutable reference to the message subscription matching the provided subject
fn find_request_subscription(&self, service: ServiceId) -> Option<&S>
fn find_request_subscription(&self, service: ServiceId) -> Option<&S>
Returns a reference to the service request subscription matching the provided subject
fn find_request_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>
fn find_request_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>
Returns a mutable reference to the service request subscription matching the provided subject
fn find_response_subscription(&self, service: ServiceId) -> Option<&S>
fn find_response_subscription(&self, service: ServiceId) -> Option<&S>
Returns a reference to the service response subscription matching the provided subject
fn find_response_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>
fn find_response_subscription_mut(
&mut self,
service: ServiceId
) -> Option<&mut S>
Returns a mutable reference to the service response subscription matching the provided subject
fn for_each_message_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
fn for_each_message_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
Executes the provided operation for each message subscription
fn for_each_request_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
fn for_each_request_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
Executes the provided operation for each request subscription
fn for_each_response_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
fn for_each_response_subscription_mut<F>(&mut self, operation: F) where
F: FnMut(&mut S),
Executes the provided operation for each response subscription
Provided methods
Returns a subscription corresponding to the provided header, if one exists