[−][src]Enum jail::param::Type
Auto-generated discriminant enum variants
Variants
Represent a list of IPv4 addresses.
Example
use jail::param::Value; let rfc1918 = Value::Ipv4Addrs(vec![ "10.0.0.0".parse().unwrap(), "172.16.0.0".parse().unwrap(), "192.168.0.0".parse().unwrap(), ]);
Represent a list of IPv6 addresses.
Example
use jail::param::Value; let all_nodes = Value::Ipv6Addrs(vec![ "ff01::1".parse().unwrap(), "ff02::1".parse().unwrap(), ]);
Implementations
impl Type
[src]
pub fn of_param(name: &str) -> Result<Type, JailError>
[src]
Get a parameter type from the name
Examples
use jail::param::Type; assert_eq!(Type::of_param("osreldate").unwrap(), Type::Int); assert_eq!(Type::of_param("osrelease").unwrap(), Type::String); assert_eq!(Type::of_param("ip4.addr").unwrap(), Type::Ipv4Addrs); assert_eq!(Type::of_param("ip6.addr").unwrap(), Type::Ipv6Addrs);
pub fn is_string(&self) -> bool
[src]
Check if this type is a string.
Example
use jail::param::Type; assert_eq!(Type::String.is_string(), true); assert_eq!(Type::Int.is_string(), false);
pub fn is_numeric(&self) -> bool
[src]
Check if this type is numeric
Example
use jail::param::Type; assert_eq!(Type::Int.is_numeric(), true); assert_eq!(Type::String.is_numeric(), false);
pub fn is_signed(&self) -> bool
[src]
Check if this type is signed
Example
use jail::param::Type; assert_eq!(Type::Int.is_signed(), true); assert_eq!(Type::Uint.is_signed(), false); // Non-numeric types return false assert_eq!(Type::String.is_signed(), false);
pub fn is_ip(&self) -> bool
[src]
Check if this type is an IP address list
Example
use jail::param::Type; assert_eq!(Type::Ipv4Addrs.is_ip(), true); assert_eq!(Type::Ipv6Addrs.is_ip(), true); assert_eq!(Type::String.is_ip(), false);
pub fn is_ipv4(&self) -> bool
[src]
Check if this type is an IPv4 address list
Example
use jail::param::Type; assert_eq!(Type::Ipv4Addrs.is_ipv4(), true); assert_eq!(Type::Ipv6Addrs.is_ipv4(), false);
pub fn is_ipv6(&self) -> bool
[src]
Check if this type is an IPv4 address list
Example
use jail::param::Type; assert_eq!(Type::Ipv6Addrs.is_ipv6(), true); assert_eq!(Type::Ipv4Addrs.is_ipv6(), false);
Trait Implementations
impl Clone for Type
[src]
impl Copy for Type
[src]
impl Debug for Type
[src]
impl Eq for Type
[src]
impl<'_enum> From<&'_enum Value> for Type
[src]
impl From<Value> for Type
[src]
impl Hash for Type
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<CtlType> for Type
[src]
impl Ord for Type
[src]
fn cmp(&self, other: &Type) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Type> for Type
[src]
impl PartialOrd<Type> for Type
[src]
fn partial_cmp(&self, other: &Type) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Type
[src]
impl StructuralPartialEq for Type
[src]
Auto Trait Implementations
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,