pub struct Service<S> { /* private fields */ }Expand description
Runtime for a ZeekClient.
Implementations§
Source§impl<C: ZeekClient> Service<C>
impl<C: ZeekClient> Service<C>
Sourcepub fn new_with_config<F>(config: ServiceConfig, init: F) -> Self
pub fn new_with_config<F>(config: ServiceConfig, init: F) -> Self
Construct a new service which the given configuration. The returned Service needs to be
started with Service::serve.
Sourcepub fn new<F>(init: F) -> Self
pub fn new<F>(init: F) -> Self
Constructs a new service with the default configuration. See
Service::new_with_config and ServiceConfig::default for more details.
Sourcepub async fn serve<S, T>(
self,
app_name: S,
uri: Uri,
subscriptions: T,
) -> Result<(), Error>
pub async fn serve<S, T>( self, app_name: S, uri: Uri, subscriptions: T, ) -> Result<(), Error>
Run the client against the server until either
- the client drops its event sender, or
- we encounter a fatal error.
§Errors
We return errors for
- transport-related issues which are not recoverable
- errors to deserialize messages
Auto Trait Implementations§
impl<S> Freeze for Service<S>where
S: Freeze,
impl<S> RefUnwindSafe for Service<S>where
S: RefUnwindSafe,
impl<S> Send for Service<S>where
S: Send,
impl<S> Sync for Service<S>where
S: Sync,
impl<S> Unpin for Service<S>where
S: Unpin,
impl<S> UnwindSafe for Service<S>where
S: UnwindSafe,
Blanket Implementations§
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