Struct taos_query::common::Field
source · pub struct Field { /* private fields */ }Expand description
A Field represents the name and data type of one column or tag.
For example, a table as “create table tb1 (ts timestamp, n nchar(100))”.
When query with “select * from tb1”, you will get two fields:
{ name: "ts", ty: Timestamp, bytes: 8 }, aTIMESTAMPfield with namets, bytes length 8 which is the byte-width ofi64.{ name: "n", ty: NChar, bytes: 100 }, aNCHARfiled with namen, bytes length 100 which is the length of the variable-length data.
Implementations§
source§impl Field
impl Field
pub const fn empty() -> Self
pub fn new(name: impl Into<String>, ty: Ty, bytes: u32) -> Self
sourcepub fn escaped_name(&self) -> String
pub fn escaped_name(&self) -> String
Escaped file name
sourcepub const fn bytes(&self) -> u32
pub const fn bytes(&self) -> u32
Preset length of variable length data type.
It’s the byte-width in other types.
pub fn to_c_field(&self) -> c_field_t
Trait Implementations§
source§impl<'de> Deserialize<'de> for Field
impl<'de> Deserialize<'de> for Field
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Inlinable for Field
impl Inlinable for Field
source§fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>
fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>
Write inlined bytes to a writer.
fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>where Self: Sized,
source§fn write_inlined_with<W: Write>(
&self,
wtr: &mut W,
_opts: InlineOpts
) -> Result<usize>
fn write_inlined_with<W: Write>( &self, wtr: &mut W, _opts: InlineOpts ) -> Result<usize>
Write inlined bytes with specific options
source§fn printable_inlined(&self) -> String
fn printable_inlined(&self) -> String
Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.