#[non_exhaustive]pub struct DataTableColumnInfo {
pub column_index: i32,
pub original_column: String,
pub key_column: bool,
pub repeated_values: bool,
pub path_or_type: Option<PathOrType>,
/* private fields */
}Expand description
DataTableColumnInfo represents the column metadata of the datatable. The column_index represents the ordering of the values in DataTableRow.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.column_index: i32Required. Column Index. 0,1,2…
original_column: StringRequired. Original column name of the Data Table (present in the CSV header in case of creation of data tables using file uploads). It must satisfy the following requirements:
- Starts with letter.
- Contains only letters, numbers and underscore.
- Must be unique and has length < 256.
key_column: boolOptional. Whether to include this column in the calculation of the row ID. If no columns have key_column = true, all columns will be included in the calculation of the row ID.
repeated_values: boolOptional. Whether the column is a repeated values column.
path_or_type: Option<PathOrType>Implementations§
Source§impl DataTableColumnInfo
impl DataTableColumnInfo
Sourcepub fn set_column_index<T: Into<i32>>(self, v: T) -> Self
pub fn set_column_index<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_original_column<T: Into<String>>(self, v: T) -> Self
pub fn set_original_column<T: Into<String>>(self, v: T) -> Self
Sets the value of original_column.
§Example
let x = DataTableColumnInfo::new().set_original_column("example");Sourcepub fn set_key_column<T: Into<bool>>(self, v: T) -> Self
pub fn set_key_column<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_repeated_values<T: Into<bool>>(self, v: T) -> Self
pub fn set_repeated_values<T: Into<bool>>(self, v: T) -> Self
Sets the value of repeated_values.
§Example
let x = DataTableColumnInfo::new().set_repeated_values(true);Sourcepub fn set_path_or_type<T: Into<Option<PathOrType>>>(self, v: T) -> Self
pub fn set_path_or_type<T: Into<Option<PathOrType>>>(self, v: T) -> Self
Sets the value of path_or_type.
Note that all the setters affecting path_or_type are mutually
exclusive.
§Example
use google_cloud_chronicle_v1::model::data_table_column_info::PathOrType;
let x = DataTableColumnInfo::new().set_path_or_type(Some(PathOrType::MappedColumnPath("example".to_string())));Sourcepub fn mapped_column_path(&self) -> Option<&String>
pub fn mapped_column_path(&self) -> Option<&String>
The value of path_or_type
if it holds a MappedColumnPath, None if the field is not set or
holds a different branch.
Sourcepub fn set_mapped_column_path<T: Into<String>>(self, v: T) -> Self
pub fn set_mapped_column_path<T: Into<String>>(self, v: T) -> Self
Sets the value of path_or_type
to hold a MappedColumnPath.
Note that all the setters affecting path_or_type are
mutually exclusive.
§Example
let x = DataTableColumnInfo::new().set_mapped_column_path("example");
assert!(x.mapped_column_path().is_some());
assert!(x.column_type().is_none());Sourcepub fn column_type(&self) -> Option<&DataTableColumnType>
pub fn column_type(&self) -> Option<&DataTableColumnType>
The value of path_or_type
if it holds a ColumnType, None if the field is not set or
holds a different branch.
Sourcepub fn set_column_type<T: Into<DataTableColumnType>>(self, v: T) -> Self
pub fn set_column_type<T: Into<DataTableColumnType>>(self, v: T) -> Self
Sets the value of path_or_type
to hold a ColumnType.
Note that all the setters affecting path_or_type are
mutually exclusive.
§Example
use google_cloud_chronicle_v1::model::data_table_column_info::DataTableColumnType;
let x0 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::String);
let x1 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::Regex);
let x2 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::Cidr);
assert!(x0.column_type().is_some());
assert!(x0.mapped_column_path().is_none());
assert!(x1.column_type().is_some());
assert!(x1.mapped_column_path().is_none());
assert!(x2.column_type().is_some());
assert!(x2.mapped_column_path().is_none());Trait Implementations§
Source§impl Clone for DataTableColumnInfo
impl Clone for DataTableColumnInfo
Source§fn clone(&self) -> DataTableColumnInfo
fn clone(&self) -> DataTableColumnInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more