Skip to main content

Class

Struct Class 

Source
pub struct Class(/* private fields */);
Expand description

A set of byte classes, for all and the scanning functions.

The named constants are the classes of dev/PLAN.md section 7.1.

§Examples

use parse_net::class::Class;

let host_chars = Class::UNRESERVED.union(Class::SUB_DELIM);
assert!(host_chars.contains(b'!') && !host_chars.contains(b'/'));

Implementations§

Source§

impl Class

Source

pub const TCHAR: Self

tchar (RFC 9110 section 5.6.2).

Source

pub const VCHAR: Self

VCHAR: 0x21 to 0x7E (RFC 5234).

Source

pub const OBS_TEXT: Self

obs-text: 0x80 to 0xFF (RFC 9110 section 5.5).

Source

pub const FIELD_TEXT: Self

field-vchar / SP / HTAB (RFC 9110 section 5.5).

Source

pub const QDTEXT: Self

qdtext (RFC 9110 section 5.6.4).

Source

pub const CTEXT: Self

ctext (RFC 9110 section 5.6.5).

Source

pub const QUOTED_PAIR: Self

The byte after \ in a quoted-pair: HTAB / SP / VCHAR / obs-text.

Source

pub const ETAGC: Self

etagc (RFC 9110 section 8.8.3).

Source

pub const ATTR_CHAR: Self

attr-char (RFC 8187 section 3.2.1).

Source

pub const MIME_TOKEN: Self

The MIME token characters (RFC 2045 section 5.1); unlike tchar, they include { and }.

Source

pub const UNRESERVED: Self

unreserved (RFC 3986 section 2.3).

Source

pub const SUB_DELIM: Self

sub-delims (RFC 3986 section 2.2).

Source

pub const PCHAR_NO_PCT: Self

unreserved / sub-delims / ":" / "@": pchar without pct-encoded.

Source

pub const URI_TARGET: Self

pchar / "/" / "?" plus %: the characters of a request target.

Source

pub const HEXDIG: Self

HEXDIG, either case.

Source

pub const SF_KEY_START: Self

The first byte of a Structured Field key: lcalpha / "*".

Source

pub const SF_KEY: Self

A Structured Field key byte: lcalpha / DIGIT / "_" / "-" / "." / "*".

Source

pub const SF_TOKEN: Self

A Structured Field token byte after the first: tchar / ":" / "/".

Source

pub const SF_STRING: Self

An unescaped Structured Field string byte: %x20-21 / %x23-5B / %x5D-7E.

Source

pub const TOKEN68: Self

A token68 byte (RFC 9110 section 11.2), without the = padding.

Source

pub const BASE64: Self

The base64 alphabet (RFC 4648 section 4), without the = padding.

Source

pub const ATEXT: Self

atext (RFC 5322 section 3.2.3).

Source

pub const BCHAR_NOSPACE: Self

bcharsnospace (RFC 2046 section 5.1.1).

Source

pub const COOKIE_OCTET: Self

cookie-octet (rfc6265bis section 4.1.1), for cookie-net.

Source

pub const AV_OCTET: Self

Cookie attribute value bytes (rfc6265bis section 4.1.1), for cookie-net.

Source

pub const fn contains(self, b: u8) -> bool

Whether b is in this class.

Source

pub const fn union(self, other: Self) -> Self

A class holding the bytes of both.

Trait Implementations§

Source§

impl Clone for Class

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Class

Source§

impl Debug for Class

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Class

Source§

impl Hash for Class

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Class

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Class

Auto Trait Implementations§

§

impl Freeze for Class

§

impl RefUnwindSafe for Class

§

impl Send for Class

§

impl Sync for Class

§

impl Unpin for Class

§

impl UnsafeUnpin for Class

§

impl UnwindSafe for Class

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.