Struct cassandra_cpp::DataType

source ·
pub struct DataType(/* private fields */);
Expand description

Any Cassandra datatype. This is an owned type.

Implementations§

source§

impl DataType

source

pub fn new(value_type: ValueType) -> Self

Creates a new data type with value type.

source

pub fn new_user_type(&self) -> UserType

Creates a new data type from an existing data type.

source

pub fn new_from_existing(&self) -> Self

Creates a new data type from an existing data type.

source

pub fn new_tuple(item_count: usize) -> Self

Creates a new tuple data type.

source

pub fn new_udt(field_count: usize) -> DataType

Creates a new UDT (user defined type) data type.

source

pub fn get_type(data_type: DataType) -> ValueType

Gets the value type of the specified data type.

source

pub fn type_name<S>(data_type: DataType, type_name: S) -> Result<()>
where S: Into<String>,

Gets the type name of a UDT data type.

source

pub fn set_type_name<S>(data_type: DataType, type_name: S) -> Result<()>
where S: Into<String>,

Sets the type name of a UDT data type.

Note: Only valid for UDT data types.

source

pub fn keyspace<S>(data_type: DataType, keyspace: S) -> Result<()>
where S: Into<String>,

Gets the type name of a UDT data type.

Note: Only valid for UDT data types.

source

pub fn set_keyspace<S>(data_type: DataType, keyspace: S) -> Result<()>
where S: Into<String>,

Sets the keyspace of a UDT data type.

Note: Only valid for UDT data types.

source

pub fn class_name<S>(data_type: DataType, class_name: S) -> Result<()>
where S: Into<String>,

Gets the class name of a custom data type.

Note: Only valid for custom data types.

source

pub fn set_class_name<S>(&self, class_name: S) -> Result<()>
where S: Into<String>,

Sets the class name of a custom data type.

Note: Only valid for custom data types.

source

pub fn sub_type_count<S>(&self) -> usize

Gets the sub-data type count of a UDT (user defined type), tuple or collection.

Note: Only valid for UDT, tuple and collection data types.

source

pub fn sub_data_type(&self, index: usize) -> ConstDataType<'_>

Gets the sub-data type of a UDT (user defined type), tuple or collection at the specified index.

Note: Only valid for UDT, tuple and collection data types.

source

pub fn sub_data_type_by_name<S>(&self, name: S) -> ConstDataType<'_>
where S: Into<String>,

Gets the sub-data type of a UDT (user defined type) at the specified index.

Note: Only valid for UDT data types.

source

pub fn sub_type_name<S>(&self, index: usize, name: S) -> Result<()>
where S: Into<String>,

Gets the sub-type name of a UDT (user defined type) at the specified index.

Note: Only valid for UDT data types.

source

pub fn add_sub_type(&self, sub_data_type: DataType) -> Result<()>

Adds a sub-data type to a tuple or collection.

Note: Only valid for tuple and collection data types.

source

pub fn add_sub_type_by_name<S>( &mut self, name: S, sub_data_type: DataType ) -> Result<()>
where S: Into<String>,

Gets the sub-data type of a UDT (user defined type) at the specified index.

Note: Only valid for UDT data types.

source

pub fn add_sub_value_type<S>(&self, sub_value_type: ValueType) -> Result<()>
where S: Into<String>,

Adds a sub-data type to a tuple or collection using a value type.

Note: Only valid for tuple and collection data types.

source

pub fn add_sub_value_type_by_name<S>( &self, name: S, typ: ValueType ) -> Result<()>
where S: Into<String>,

Adds a sub-data type to a tuple or collection using a value type.

Note: Only valid for tuple and collection data types.

Trait Implementations§

source§

impl Debug for DataType

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for DataType

source§

fn drop(&mut self)

Frees a data type instance.

source§

impl Send for DataType

source§

impl Sync for DataType

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>,

§

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>,

§

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.
source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,