Skip to main content

Service

Trait Service 

Source
pub trait Service {
    // Required methods
    fn can_handle_service(&self, service_name: &str) -> bool;
    fn process_stream(
        &mut self,
        service_name: &str,
        channel: Channel,
    ) -> Result<(), Error>;
}
Expand description

Trait for providing a service.

Required Methods§

Source

fn can_handle_service(&self, service_name: &str) -> bool

Returns true if this service can process the given service name, false otherwise.

Source

fn process_stream( &mut self, service_name: &str, channel: Channel, ) -> Result<(), Error>

Processes the request stream within the specified channel. Ok is returned on success, an error otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§