pub struct Table { /* private fields */ }
Expand description
A table specifying the byte patterns allowed in a string.
Implementations§
source§impl Table
impl Table
sourcepub const fn new(bytes: &[u8]) -> Table
pub const fn new(bytes: &[u8]) -> Table
Creates a table that only allows the given unencoded bytes.
§Panics
Panics if any of the bytes is not ASCII or equals b'%'
.
sourcepub const fn or(self, other: &Table) -> Table
pub const fn or(self, other: &Table) -> Table
Combines two tables into one.
Returns a new table that allows all the byte patterns allowed
by self
or by other
.
sourcepub const fn or_pct_encoded(self) -> Table
pub const fn or_pct_encoded(self) -> Table
Marks this table as allowing percent-encoded octets.
sourcepub const fn or_ucschar(self) -> Table
pub const fn or_ucschar(self) -> Table
Marks this table as allowing characters matching the ucschar
ABNF rule from RFC 3987.
sourcepub const fn or_iprivate(self) -> Table
pub const fn or_iprivate(self) -> Table
Marks this table as allowing characters matching the iprivate
ABNF rule from RFC 3987.
sourcepub const fn sub(self, other: &Table) -> Table
pub const fn sub(self, other: &Table) -> Table
Subtracts from this table.
Returns a new table that allows all the byte patterns allowed
by self
but not allowed by other
.
sourcepub const fn is_subset(&self, other: &Table) -> bool
pub const fn is_subset(&self, other: &Table) -> bool
Checks whether the table is a subset of another, i.e., other
allows at least all the byte patterns allowed by self
.
sourcepub const fn allows(&self, ch: char) -> bool
pub const fn allows(&self, ch: char) -> bool
Checks whether the given unencoded character is allowed by the table.
sourcepub const fn allows_pct_encoded(&self) -> bool
pub const fn allows_pct_encoded(&self) -> bool
Checks whether percent-encoded octets are allowed by the table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)