[−][src]Enum http_desync_guardian::http_token_utils::TokenSimilarity
Variants
If two token are identical, i.e. equal ignoring case.
use http_desync_guardian::http_token_utils::*; use http_desync_guardian::http_token_utils::TokenSimilarity::*; assert_eq!(determine_similarity(http_token("token"), http_token("Token")), Identical); assert_eq!(determine_similarity(http_token("same-token"), http_token("Same-Token")), Identical);
If two tokens differ only by non-letter characters.
use http_desync_guardian::http_token_utils::*; use http_desync_guardian::http_token_utils::TokenSimilarity::*; assert_eq!(determine_similarity(http_token("token"), http_token("Token\t")), SameLetters); assert_eq!(determine_similarity(http_token("same-token"), http_token("Same\t-Token")), SameLetters);
Otherwise it's Distant
. E.g. "some-token" and "other-token"
use http_desync_guardian::http_token_utils::*; use http_desync_guardian::http_token_utils::TokenSimilarity::*; assert_eq!(determine_similarity(http_token("token"), http_token("Different-token")), Distant); assert_eq!(determine_similarity(http_token("same-token"), http_token("Other-token")), Distant);
Trait Implementations
impl Debug for TokenSimilarity
[src]
impl PartialEq<TokenSimilarity> for TokenSimilarity
[src]
fn eq(&self, other: &TokenSimilarity) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<TokenSimilarity> for TokenSimilarity
[src]
fn partial_cmp(&self, other: &TokenSimilarity) -> 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 StructuralPartialEq for TokenSimilarity
[src]
Auto Trait Implementations
impl RefUnwindSafe for TokenSimilarity
impl Send for TokenSimilarity
impl Sync for TokenSimilarity
impl Unpin for TokenSimilarity
impl UnwindSafe for TokenSimilarity
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, 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>,