pub struct BaseLogEntry {Show 16 fields
pub queue_id: Option<String>,
pub message_id: Option<String>,
pub from_email: Option<EmailAddress>,
pub to_email: Option<EmailAddress>,
pub orig_to_email: Option<EmailAddress>,
pub client_info: Option<ClientInfo>,
pub relay_info: Option<RelayInfo>,
pub delay_info: Option<DelayInfo>,
pub status_info: Option<StatusInfo>,
pub size: Option<u64>,
pub nrcpt: Option<u32>,
pub protocol: Option<String>,
pub helo: Option<String>,
pub sasl_method: Option<String>,
pub sasl_username: Option<String>,
pub raw_message: String,
}
Expand description
Postfix日志基础结构体 包含所有组件通用的字段,避免重复解析
Fields§
§queue_id: Option<String>
队列ID(如果有)
message_id: Option<String>
Message-ID(如果有)
from_email: Option<EmailAddress>
发件人地址
to_email: Option<EmailAddress>
收件人地址
orig_to_email: Option<EmailAddress>
原始收件人地址(alias/forward前)
client_info: Option<ClientInfo>
客户端连接信息
relay_info: Option<RelayInfo>
中继主机信息
delay_info: Option<DelayInfo>
延迟信息
status_info: Option<StatusInfo>
状态信息
size: Option<u64>
邮件大小(字节)
nrcpt: Option<u32>
收件人数量
protocol: Option<String>
协议类型(SMTP/ESMTP)
helo: Option<String>
HELO/EHLO信息
sasl_method: Option<String>
SASL认证方法
sasl_username: Option<String>
SASL用户名
raw_message: String
原始日志消息(去除时间戳和组件名)
Implementations§
Source§impl BaseLogEntry
impl BaseLogEntry
Sourcepub fn from_message(raw_message: &str, queue_id: Option<String>) -> Self
pub fn from_message(raw_message: &str, queue_id: Option<String>) -> Self
Sourcepub fn has_delivery_info(&self) -> bool
pub fn has_delivery_info(&self) -> bool
检查是否包含邮件传输相关的字段
Sourcepub fn has_client_info(&self) -> bool
pub fn has_client_info(&self) -> bool
检查是否包含客户端连接信息
Sourcepub fn has_auth_info(&self) -> bool
pub fn has_auth_info(&self) -> bool
检查是否包含认证信息
Sourcepub fn formatted_from(&self) -> String
pub fn formatted_from(&self) -> String
获取格式化的发件人地址字符串
Sourcepub fn formatted_to(&self) -> String
pub fn formatted_to(&self) -> String
获取格式化的收件人地址字符串
Sourcepub fn formatted_client(&self) -> String
pub fn formatted_client(&self) -> String
获取格式化的客户端信息字符串
Sourcepub fn formatted_relay(&self) -> String
pub fn formatted_relay(&self) -> String
获取格式化的中继信息字符串
Sourcepub fn formatted_status(&self) -> String
pub fn formatted_status(&self) -> String
获取格式化的状态信息字符串
Trait Implementations§
Source§impl Clone for BaseLogEntry
impl Clone for BaseLogEntry
Source§fn clone(&self) -> BaseLogEntry
fn clone(&self) -> BaseLogEntry
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 BaseLogEntry
impl Debug for BaseLogEntry
Source§impl<'de> Deserialize<'de> for BaseLogEntry
impl<'de> Deserialize<'de> for BaseLogEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BaseLogEntry
impl PartialEq for BaseLogEntry
Source§impl Serialize for BaseLogEntry
impl Serialize for BaseLogEntry
impl StructuralPartialEq for BaseLogEntry
Auto Trait Implementations§
impl Freeze for BaseLogEntry
impl RefUnwindSafe for BaseLogEntry
impl Send for BaseLogEntry
impl Sync for BaseLogEntry
impl Unpin for BaseLogEntry
impl UnwindSafe for BaseLogEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more