pub trait TripcodeGenerator {
type Hash: TripcodeHash;
// Required method
fn hash<P: AsRef<[u8]>>(password: P) -> Self::Hash;
// Provided methods
fn generate<P: AsRef<[u8]>>(password: P) -> String { ... }
fn append<P: AsRef<[u8]>>(password: P, dst: &mut String) { ... }
fn write<P, W>(password: P, dst: &mut W) -> Result<()>
where P: AsRef<[u8]>,
W: Write { ... }
fn generate_sjis<P: AsRef<[u8]>>(password: P) -> Vec<u8> ⓘ { ... }
fn append_sjis<P: AsRef<[u8]>>(password: P, dst: &mut Vec<u8>) { ... }
fn write_sjis<P, W>(password: P, dst: &mut W) -> Result<()>
where P: AsRef<[u8]>,
W: Write { ... }
}
Expand description
Trait for generators of tripcodes.
Required Associated Types§
Sourcetype Hash: TripcodeHash
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§
Provided Methods§
Sourcefn append<P: AsRef<[u8]>>(password: P, dst: &mut String)
fn append<P: AsRef<[u8]>>(password: P, dst: &mut String)
Generates a tripcode from password
and appends it to a String
.
Sourcefn generate_sjis<P: AsRef<[u8]>>(password: P) -> Vec<u8> ⓘ
fn generate_sjis<P: AsRef<[u8]>>(password: P) -> Vec<u8> ⓘ
Generates a tripcode in Shift-JIS encoding.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.