[−][src]Struct svc_agent::Subscription
Messages subscription builder.
Implementations
impl Subscription[src]
pub fn broadcast_events<'a, A>(
from: &'a A,
version: &'a str,
uri: &'a str
) -> EventSubscription<'a> where
A: Authenticable, [src]
from: &'a A,
version: &'a str,
uri: &'a str
) -> EventSubscription<'a> where
A: Authenticable,
Builds an EventSubscription for broadcast events.
Use it to subscribe to events from some service,
Arguments
from– anything Addressable to receive events from. For example service AgentId.version– API version string of thefromagent. Example:v1.uri– resource path divided by/to receive events on. Example:room/ROOM_ID/events.
Example
let agent = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let subscription = Subscription::broadcast_events(&agent, "v1", "rooms/123/events");
pub fn multicast_requests(version: Option<&str>) -> RequestSubscription<'_>[src]
Builds a RequestSubscription for multicast requests from any agent.
Use it to subscribe a stateless service endpoint to its consumers' requests.
Arguments
version– API version string of thefromagent. Example:v1.
Example
let subscription = Subscription::multicast_requests("v1");
pub fn multicast_requests_from<'a, A>(
from: &'a A,
version: Option<&'a str>
) -> RequestSubscription<'a> where
A: Addressable, [src]
from: &'a A,
version: Option<&'a str>
) -> RequestSubscription<'a> where
A: Addressable,
Builds a RequestSubscription for multicast requests from a specific agent.
This is the same as multicast_requests but subscribes only from requests from a specific agent.
Arguments
from– anything Addressable to receive requests from. For example service AgentId.version– API version string of thefromagent. Example:v1.
Example
let agent = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let subscription = Subscription::multicast_requests_from(&agent, "v1");
pub fn unicast_requests<'a>() -> RequestSubscription<'a>[src]
Builds a RequestSubscription for unicast requests from any agent.
Use it to subscribe a stateful service endpoint to its consumers' requests.
Example
let subscription = Subscription::unicast_requests();
pub fn unicast_requests_from<A>(from: &A) -> RequestSubscription<'_> where
A: Authenticable, [src]
A: Authenticable,
Builds a RequestSubscription for unicast requests from a specific agent.
This is the same as unicast_requests but subscribes only from requests from a specific agent.
Arguments
from– anything Addressable to receive requests from. For example service AgentId.
Example
let agent = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let subscription = Subscription::unicast_requests(&agent);
pub fn unicast_responses<'a>() -> ResponseSubscription<'a>[src]
Builds a ResponseSubscription for unicast requests from any agent.
Use it to subscribe to responses from all services.
Example
let subscription = Subscription::unicast_responses();
pub fn unicast_responses_from<A>(from: &A) -> ResponseSubscription<'_> where
A: Authenticable, [src]
A: Authenticable,
Builds a ResponseSubscription for unicast requests from a specific agent.
This is the same as unicast_responses but subscribes only from requests from a specific agent.
Example
let agent = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let subscription = Subscription::unicast_responses_from(&agent);
Auto Trait Implementations
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnwindSafe for Subscription
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,