Enum vsmtp_rule_engine::api::Object
pub enum Object {
Ip4(Ipv4Addr),
Ip6(Ipv6Addr),
Rg4(IpRange<Ipv4Net>),
Rg6(IpRange<Ipv6Net>),
Address(Address),
Fqdn(String),
Regex(Regex),
Identifier(String),
Code(Reply),
}Expand description
vSL object type implementation.
Objects are rust’s representation of rule engine variables.
multiple types are supported.
NOTE: Objects are represented as an enum because it is easier to create containers for them.
Variants§
Ip4(Ipv4Addr)
ip v4 address. (a.b.c.d)
Ip6(Ipv6Addr)
ip v6 address. (x:x:x:x:x:x:x:x)
Rg4(IpRange<Ipv4Net>)
an ip v4 range. (a.b.c.d/range)
Rg6(IpRange<Ipv6Net>)
an ip v6 range. (x:x:x:x:x:x:x:x/range)
Address(Address)
an email address (jones@foo.com)
Fqdn(String)
a valid fully qualified domain name (foo.com)
Regex(Regex)
a regex (^[a-z0-9.]+@foo.com$)
Identifier(String)
a user identifier.
Code(Reply)
a custom smtp reply code.
Implementations§
source§impl Object
impl Object
sourcepub fn new_file(
path: impl AsRef<Path>,
content_type: impl AsRef<str>
) -> Result<Vec<Dynamic, Global>, Error>
pub fn new_file( path: impl AsRef<Path>, content_type: impl AsRef<str> ) -> Result<Vec<Dynamic, Global>, Error>
sourcepub fn new_identifier(identifier: impl Into<String>) -> Object
pub fn new_identifier(identifier: impl Into<String>) -> Object
Create a new identifier object.
source§impl Object
impl Object
sourcepub fn contains(&self, other: &Object) -> bool
pub fn contains(&self, other: &Object) -> bool
check if the other object is contained in this object,
return false automatically if the item cannot be contained in this object.
sourcepub fn contains_str(&self, other: &str) -> bool
pub fn contains_str(&self, other: &str) -> bool
check if the other string is contained in this object,
return false automatically if the item cannot be contained in this object.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Variant for Twhere
T: Any + Clone + SendSync,
impl<T> Variant for Twhere T: Any + Clone + SendSync,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.source§fn as_boxed_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn as_boxed_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Variant trait object to Box<dyn Any>.