[−][src]Struct ssri::Checker
Check data against an Integrity
.
Examples
let data = b"hello world"; let sri = Integrity::from(&data, Algorithm::Sha256); let checker = Checker::new(sri).chain(&data); assert_eq!(checker.result(), Some(Algorithm::Sha256));
Methods
impl Checker
[src]
pub fn new(sri: Integrity) -> Checker
[src]
Creates a new Checker
builder. Use this to verify chunked data.
pub fn input<B: AsRef<[u8]>>(&mut self, data: B)
[src]
Add some data to the running checker.
pub fn chain<B: AsRef<[u8]>>(self, data: B) -> Self
[src]
Same as Checker::input
, but allows chained calls.
pub fn result(self) -> Option<Algorithm>
[src]
Returns the matching algorithm if the inputted data matches the input Integrity
.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self