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 }
, aTIMESTAMP
field with namets
, bytes length 8 which is the byte-width ofi64
.{ name: "n", ty: NChar, bytes: 100 }
, aNCHAR
filed 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.
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more