Struct percent_encoding::AsciiSet
source · pub struct AsciiSet {
pub(crate) mask: [u32; 4],
}
Expand description
Represents a set of characters or bytes in the ASCII range.
This is used in percent_encode
and utf8_percent_encode
.
This is similar to percent-encode sets.
Use the add
method of an existing set to define a new set. For example:
use percent_encoding::{AsciiSet, CONTROLS};
/// https://url.spec.whatwg.org/#fragment-percent-encode-set
const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`');
Fields§
§mask: [u32; 4]
Implementations§
source§impl AsciiSet
impl AsciiSet
sourcepub(crate) const fn contains(&self, byte: u8) -> bool
pub(crate) const fn contains(&self, byte: u8) -> bool
Called with UTF-8 bytes rather than code points. Not used for non-ASCII bytes.
pub(crate) fn should_percent_encode(&self, byte: u8) -> bool
pub const fn add(&self, byte: u8) -> Self
pub const fn remove(&self, byte: u8) -> Self
Auto Trait Implementations§
impl Freeze for AsciiSet
impl RefUnwindSafe for AsciiSet
impl Send for AsciiSet
impl Sync for AsciiSet
impl Unpin for AsciiSet
impl UnwindSafe for AsciiSet
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