Struct LogicalTypeHandle

Source
pub struct LogicalTypeHandle { /* private fields */ }
Expand description

Implementations§

Source§

impl LogicalTypeHandle

Source

pub fn map(key: &Self, value: &Self) -> Self

Creates a map type from its child type.

Source

pub fn list(child_type: &Self) -> Self

Creates a list type from its child type.

Source

pub fn array(child_type: &Self, array_size: u64) -> Self

Creates an array type from its child type.

Source

pub fn decimal(width: u8, scale: u8) -> Self

Creates a decimal type from its width and scale.

Source

pub fn decimal_width(&self) -> u8

Retrieves the decimal width Returns 0 if the LogicalType is not a decimal

Source

pub fn decimal_scale(&self) -> u8

Retrieves the decimal scale Returns 0 if the LogicalType is not a decimal

Source

pub fn struct_type(fields: &[(&str, Self)]) -> Self

Make a LogicalType for struct

Source

pub fn union_type(fields: &[(&str, Self)]) -> Self

Make a LogicalType for union

Source

pub fn id(&self) -> LogicalTypeId

Logical type ID

Source

pub fn try_id(&self) -> Result<LogicalTypeId, u32>

Logical type ID, with forward-compatibility awareness.

Returns Ok(LogicalTypeId) for all known ids (including Invalid), and Err(raw_id) when DuckDB returns an id this wrapper does not yet recognize.

Source

pub fn raw_id(&self) -> u32

Raw logical type id returned by DuckDB C API

Source

pub fn num_children(&self) -> usize

Logical type children num

Source

pub fn child_name(&self, idx: usize) -> String

Logical type child name by idx

Panics if the logical type is not a struct or union

Source

pub fn child(&self, idx: usize) -> Self

Logical type child by idx

Source

pub fn get_alias(&self) -> Option<String>

Alias of the logical type.

Source

pub fn set_alias(&self, alias: &str)

Set the alias of the logical type.

Trait Implementations§

Source§

impl Debug for LogicalTypeHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Debug implementation for LogicalType

Source§

impl Drop for LogicalTypeHandle

Source§

fn drop(&mut self)

Drop implementation for LogicalType

Source§

impl From<LogicalTypeId> for LogicalTypeHandle

Source§

fn from(id: LogicalTypeId) -> Self

Create a new LogicalTypeHandle from LogicalTypeId

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.