Struct Hashed

Source
pub struct Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,
{ /* private fields */ }

Implementations§

Source§

impl<Hasher> Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,

Source

pub fn concat(&self, other: &Self) -> Self

Examples found in repository?
crates/competitive/src/string/rolling_hash.rs (line 447)
441    pub fn pow(&self, n: usize) -> Self {
442        let mut res = Hasher::empty_hash();
443        let mut x = *self;
444        let mut n = n;
445        while n > 0 {
446            if n & 1 == 1 {
447                res = res.concat(&x);
448            }
449            x = x.concat(&x);
450            n >>= 1;
451        }
452        res
453    }
Source

pub fn pow(&self, n: usize) -> Self

Trait Implementations§

Source§

impl<Hasher> Clone for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Hasher> Debug for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized + Debug, Hasher::Hash: Debug,

Source§

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

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

impl<Hasher> Hash for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized, Hasher::Hash: Hash,

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<Hasher> PartialEq for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Hasher> Copy for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,

Source§

impl<Hasher> Eq for Hashed<Hasher>
where Hasher: RollingHasher + ?Sized,

Auto Trait Implementations§

§

impl<Hasher> Freeze for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: Freeze, Hasher: ?Sized,

§

impl<Hasher> RefUnwindSafe for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: RefUnwindSafe, Hasher: ?Sized,

§

impl<Hasher> Send for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: Send, Hasher: ?Sized,

§

impl<Hasher> Sync for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: Sync, Hasher: ?Sized,

§

impl<Hasher> Unpin for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: Unpin, Hasher: ?Sized,

§

impl<Hasher> UnwindSafe for Hashed<Hasher>
where <Hasher as RollingHasher>::Hash: UnwindSafe, Hasher: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.