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