Trait tripcode::TripcodeGeneratorFailable [] [src]

pub trait TripcodeGeneratorFailable {
    type Hash: TripcodeHash;
    fn try_hash<P: AsRef<[u8]>>(password: P) -> Option<Self::Hash>;

    fn try_generate<P: AsRef<[u8]>>(password: P) -> Option<String> { ... }
    fn try_append<P: AsRef<[u8]>>(password: P, dst: &mut String) -> Option<()> { ... }
    fn try_write<P, W>(password: P, dst: &mut W) -> Option<Result<()>>
    where
        P: AsRef<[u8]>,
        W: Write
, { ... } fn try_generate_sjis<P: AsRef<[u8]>>(password: P) -> Option<Vec<u8>> { ... } fn try_append_sjis<P: AsRef<[u8]>>(
        password: P,
        dst: &mut Vec<u8>
    ) -> Option<()> { ... } fn try_write_sjis<P, W>(password: P, dst: &mut W) -> Option<Result<()>>
    where
        P: AsRef<[u8]>,
        W: Write
, { ... } }

Trait for tripcode generators which may fail in generation.

Associated Types

The type of hash value that represents resulting tripcodes.

See the documentation for tripcode::hash module for the information of the hash value.

Required Methods

Attempts to generate a hash value from password.

Returns None when passed an invalid password.

Provided Methods

Attempts to generate a tripcode from password.

Returns None when passed an invalid password.

Attempts to generate a tripcode and append it to a String.

Returns None when passed an invalid password.

Attempts to generate a tripcode into a Write.

Returns None when passed an invalid password.

Attempts to generate a tripcode in Shift-JIS encoding.

Returns None when passed an invalid password.

Attempts to generate a Shift-JIS-encoded tripcode and append it to a Vec<u8>.

Returns None when passed an invalid password.

Attempts to generate a Shift-JIS-encoded tripcode into a Write.

Returns None when passed an invalid password.

Implementors