Enum server::storage::types::SqlType [] [src]

pub enum SqlType {
    Int,
    Bool,
    Char(u8),
}

General enums in SQL

Variants

Int
Bool
Char

Methods

impl SqlType

Defines the size of Sql data types and returns them

fn size(&self) -> u32

fn decode_from<R: Read>(&self, buf: &mut R) -> Result<Lit, Error>

Decodes the data in buf according to SqlType into a Lit enum.

fn encode_into<W: Write>(&self, buf: &mut W, data: &Lit) -> Result<u32, Error>

Writes data to buf Returns the bytes written. Returns Error::InvalidType if type of Lit does not match expected type. Returns byteorder::Error, if data could not be written to buf. Lit: contains data to write to buf buf: target of write operation.

fn cmp(&self, val: &[u8], val2: &[u8], comp: CompType) -> Result<bool, Error>

compare function that lets you logical compare slices of u8 returns a boolean on success and Error on fail uses other compare fn for the actual compare

Trait Implementations

Derived Implementations

impl PartialEq for SqlType

fn eq(&self, __arg_0: &SqlType) -> bool

fn ne(&self, __arg_0: &SqlType) -> bool

impl Encodable for SqlType

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Decodable for SqlType

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<SqlType, __D::Error>

impl Copy for SqlType

impl Clone for SqlType

fn clone(&self) -> SqlType

fn clone_from(&mut self, source: &Self)

impl Debug for SqlType

fn fmt(&self, __arg_0: &mut Formatter) -> Result