Trait AsyncSyslogTap

Source
pub trait AsyncSyslogTap<D: AsyncSyslogDestination + Display>: Debug + Send {
    // Required methods
    fn new(req_tap: D) -> SyRes<Self>
       where Self: Sized;
    async fn connectlog(&mut self) -> SyRes<()>;
    async fn send(&mut self, msg: &[u8]) -> Result<usize>;
    async fn disconnectlog(&mut self) -> Result<()>;
    fn is_connected(&self) -> bool;
    fn get_type(&self) -> TapType;
    fn get_max_msg_size(&self) -> usize;
    fn update_tap_data(&mut self, tap_data: D);
}
Expand description

A trait which implements the necessary functions for syslog internals. It taps the connection and provides the functionality for the syslog client to use the communication channel.

Required Methods§

Source

fn new(req_tap: D) -> SyRes<Self>
where Self: Sized,

Proves the new instance of the syslog communication.

§Arguments

req_tap - a connection endpoint setup information i.e address, path…

§Returns

In case of any error a SyRes i.e Result::Err should be returned.

Source

async fn connectlog(&mut self) -> SyRes<()>

Opens a connection to target.

Source

async fn send(&mut self, msg: &[u8]) -> Result<usize>

Writes provided data to socket

Source

async fn disconnectlog(&mut self) -> Result<()>

Disconnects the connection.

Source

fn is_connected(&self) -> bool

Tells if connection was opened.

Source

fn get_type(&self) -> TapType

Returns the exact type of the connection.

Source

fn get_max_msg_size(&self) -> usize

Returns (in bytes) the maximum message size (including headers).

Source

fn update_tap_data(&mut self, tap_data: D)

Updates the connection information without breaking tap.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§