pub struct TableDesc { /* private fields */ }
Expand description

Information about the structure of a CASA table.

From the casacore documentation: “A TableDesc object contains the description, or structure, of a table. This description is required for the creation of a new table. Descriptions are subsequently associated with every table and embedded in them.”“

Examples

Create a description of a table named “TYPE”, with a scalar string column named “A” with comment “string”, a column of unsigned integer arrays of no fixed size named “B” with comment “uint array”, and a column of double precision complex number arrays of shape [4] named “C” with comment “fixed complex vector”

use rubbl_casatables::{GlueDataType, TableDescCreateMode, TableDesc};

let mut table_desc = TableDesc::new("TYPE", TableDescCreateMode::TDM_SCRATCH).unwrap();
table_desc
    .add_scalar_column(GlueDataType::TpString, "A", Some("string"), false, false).unwrap();
table_desc
    .add_array_column(GlueDataType::TpUInt, "B", Some("uint array"), None, false, false).unwrap();
table_desc
    .add_array_column(GlueDataType::TpDComplex, "C", Some("fixed complex vector"), Some(&[4]), false, false).unwrap();

Implementations§

Create a new TableDesc.

name - The name of the table description. From casacore: This name can be seen as the table type in the same way as a class name is the data type of an object.

mode - The mode in which to create the table description. For compatibility with casacore, multiple options are provided, however you most likely want to go with Scratch, as this avoids writing a .tabdsc file to disk.

Add a scalar column to the TableDesc

Add an array column to the TableDesc

If dimensions (dims) are provided, then the column has fixed dimensions, other wise the column is not fixed.

Set the number of dimensions of a column

Return a copy of the keyword TableRecord

Return a copy of the keyword TableRecord for a given column.

Add a “keyword” to be associated with a particular column in this table description.

col_name - The name of the affected column.

kw_name - The name of the keyword to apply to the column.

value - The value to associate with the keyword.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.