[−][src]Struct viaspf::record::Macro
A macro.
Examples
use std::num::NonZeroU8; use viaspf::record::*; let mut m = Macro::new(MacroKind::Domain); assert_eq!(m.to_string(), "%{d}"); m.set_url_encode(true); m.set_limit(NonZeroU8::new(3).unwrap()); m.set_reverse(true); m.set_delimiters(Delimiters::new(".+").unwrap()); assert_eq!(m.to_string(), "%{D3r.+}");
Implementations
impl Macro
[src]
pub fn new(kind: MacroKind) -> Macro
[src]
Creates a new macro of the given kind.
pub fn kind(&self) -> MacroKind
[src]
Returns the macro kind.
pub fn set_kind(&mut self, value: MacroKind)
[src]
Configures the macro’s kind.
pub fn url_encode(&self) -> bool
[src]
Returns whether the macro should undergo URL encoding.
pub fn set_url_encode(&mut self, value: bool)
[src]
Configures whether the macro should undergo URL encoding.
pub fn limit(&self) -> Option<NonZeroU8>
[src]
Returns the macro’s size limit transformer.
pub fn set_limit<L>(&mut self, value: L) where
L: Into<Option<NonZeroU8>>,
[src]
L: Into<Option<NonZeroU8>>,
Configures the macro’s size limit transformer.
pub fn reverse(&self) -> bool
[src]
Returns the macro’s reverse transformer.
pub fn set_reverse(&mut self, value: bool)
[src]
Configures the macro’s reverse transformer.
pub fn delimiters(&self) -> Option<&Delimiters>
[src]
Returns the macro’s delimiters.
pub fn set_delimiters<D>(&mut self, value: D) where
D: Into<Option<Delimiters>>,
[src]
D: Into<Option<Delimiters>>,
Configures the macro’s delimiters.
Trait Implementations
impl Clone for Macro
[src]
impl Debug for Macro
[src]
impl Display for Macro
[src]
impl Eq for Macro
[src]
impl From<Macro> for MacroExpand
[src]
impl From<MacroKind> for Macro
[src]
impl Hash for Macro
[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 PartialEq<Macro> for Macro
[src]
impl StructuralEq for Macro
[src]
impl StructuralPartialEq for Macro
[src]
Auto Trait Implementations
impl RefUnwindSafe for Macro
impl Send for Macro
impl Sync for Macro
impl Unpin for Macro
impl UnwindSafe for Macro
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,