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
type Hash: TripcodeHash
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
fn try_hash<P: AsRef<[u8]>>(password: &P) -> Option<Self::Hash>
Attempts to generate a hash value from password
.
Returns None
when passed an invalid password.
Provided Methods
fn try_generate<P: AsRef<[u8]>>(password: &P) -> Option<String>
Attempts to generate a tripcode from password
.
Returns None
when passed an invalid password.
fn try_append<P: AsRef<[u8]>>(password: &P, dst: &mut String) -> Option<()>
Attempts to generate a tripcode into a String
.
Returns None
when passed an invalid password.
fn try_write<P, W>(password: &P, dst: &mut W) -> Option<Result<()>> where P: AsRef<[u8]>, W: Write
Attempts to generate a tripcode into a Write
.
Returns None
when passed an invalid password.
fn try_generate_sjis<P: AsRef<[u8]>>(password: &P) -> Option<Vec<u8>>
Attempts to generate a tripcode in Shift-JIS encoding.
Returns None
when passed an invalid password.
fn try_append_sjis<P: AsRef<[u8]>>(password: &P, dst: &mut Vec<u8>) -> Option<()>
Attempts to generate a Shift-JIS-encoded tripcode into a Vec<u8>
.
Returns None
when passed an invalid password.
fn try_write_sjis<P, W>(password: &P, dst: &mut W) -> Option<Result<()>> where P: AsRef<[u8]>, W: Write
Attempts to generate a Shift-JIS-encoded tripcode into a Write
.
Returns None
when passed an invalid password.
Implementors
impl<T> TripcodeGeneratorFailable for T where T: TripcodeGenerator
impl TripcodeGeneratorFailable for MonaRaw