Trait tripcode::hash::TripcodeHash [] [src]

pub trait TripcodeHash: Sized {
    fn decode(tripcode: &str) -> Option<Self>;
    fn max_len() -> usize;
    fn max_len_sjis() -> usize;
    fn append(self, _: &mut String);
    fn write<W: Write>(self, _: &mut W) -> Result<()>;
    fn decode_from_sjis(_: &[u8]) -> Option<Self>;
    fn append_sjis(self, _: &mut Vec<u8>);
    fn write_sjis<W: Write>(self, _: &mut W) -> Result<()>;

    fn encode(self) -> String { ... }
    fn encode_to_sjis(self) -> Vec<u8> { ... }
}

Trait for hash values that represent tripcodes.

Required Methods

Decodes a tripcode into a hash value.

Returns None when passed a invalid tripcode.

Returns maximum length of resulting tripcode, in bytes.

Returns maximum length of resulting tripcode when encoded in Shift-JIS, in bytes.

Encodes self into a tripcode and appends it on a String.

Encodes self into a tripcode and writes it to a Write.

Decodes a Shift-JIS-encoded tripcode.

Encodes self into a Shift-JIS-encoded tripcode and appends it on a Vec<u8>.

Encodes self into a Shift-JIS-encoded tripcode and writes it to a Write.

Provided Methods

Encodes self into a tripcode.

Encodes self into a Shift-JIS-encoded tripcode.

Implementors