pub struct SyslogNetTcp { /* private fields */ }
Expand description
A remote syslog server which works over plain TCP.
Implementations§
Source§impl SyslogNetTcp
impl SyslogNetTcp
Sourcepub fn new<P>(
remote: P,
local: Option<P>,
conn_timeout: Option<Duration>,
) -> SyRes<Self>
pub fn new<P>( remote: P, local: Option<P>, conn_timeout: Option<Duration>, ) -> SyRes<Self>
Creates a new TCP connection to syslog server.
§Arguments
-
dest_addr
- a server’s address in form “ip:port” -
local
- a local bind address in format “ip:port”. Optional. If not set, then will bind to 0.0.0.0 i.e OS specific. -
conn_timeout
- an optional connection timeout. If not specified, then TCP connection timeout (OS specific).
pub fn get_remote_addr(&self) -> &SocketAddr
pub fn get_bind_addr(&self) -> &SocketAddr
pub fn get_conn_timeout(&self) -> Option<Duration>
Trait Implementations§
Source§impl AsyncSyslogTap<SyslogNetTcp> for AsyncTap<TcpStream, SyslogNetTcp>
impl AsyncSyslogTap<SyslogNetTcp> for AsyncTap<TcpStream, SyslogNetTcp>
Source§fn new(req_tap: SyslogNetTcp) -> SyRes<Self>
fn new(req_tap: SyslogNetTcp) -> SyRes<Self>
Proves the new instance of the syslog communication. Read more
Source§async fn connectlog(&mut self) -> SyRes<()>
async fn connectlog(&mut self) -> SyRes<()>
Opens a connection to target.
Source§async fn disconnectlog(&mut self) -> Result<()>
async fn disconnectlog(&mut self) -> Result<()>
Disconnects the connection.
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Tells if connection was opened.
Source§fn get_max_msg_size() -> usize
fn get_max_msg_size() -> usize
Returns (in bytes) the maximum message size (including headers).
Source§fn update_tap_data(&mut self, tap_data: SyslogNetTcp)
fn update_tap_data(&mut self, tap_data: SyslogNetTcp)
Updates the connection information without breaking tap.
Source§impl Clone for SyslogNetTcp
impl Clone for SyslogNetTcp
Source§fn clone(&self) -> SyslogNetTcp
fn clone(&self) -> SyslogNetTcp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SyslogNetTcp
impl Debug for SyslogNetTcp
Source§impl Display for SyslogNetTcp
impl Display for SyslogNetTcp
Source§impl SyslogDestMsg for SyslogNetTcp
impl SyslogDestMsg for SyslogNetTcp
Source§fn get_max_msg_len() -> usize
fn get_max_msg_len() -> usize
Should return the max message length for specific syslog server type.
Source§impl SyslogDestination for SyslogNetTcp
impl SyslogDestination for SyslogNetTcp
const DEST_TYPE: DestinationType = DestinationType::Network
Source§type SocketTap = Tap<TcpStream, SyslogNetTcp>
type SocketTap = Tap<TcpStream, SyslogNetTcp>
A provider of the connection to syslog for sync code.
Auto Trait Implementations§
impl Freeze for SyslogNetTcp
impl RefUnwindSafe for SyslogNetTcp
impl Send for SyslogNetTcp
impl Sync for SyslogNetTcp
impl Unpin for SyslogNetTcp
impl UnwindSafe for SyslogNetTcp
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