Struct spacetimedb_lib::relation::Header
source · pub struct Header {
pub table_name: String,
pub fields: Vec<Column>,
}Fields§
§table_name: String§fields: Vec<Column>Implementations§
source§impl Header
impl Header
pub fn new(table_name: &str, fields: &[Column]) -> Self
pub fn from_product_type(table_name: &str, fields: ProductType) -> Self
pub fn for_mem_table(fields: ProductType) -> Self
pub fn as_without_table_name(&self) -> HeaderOnlyField<'_>
pub fn ty(&self) -> ProductType
pub fn find_by_name(&self, field_name: &str) -> Option<&Column>
pub fn column_pos<'a>(&'a self, col: &'a FieldName) -> Option<usize>
sourcepub fn find_pos_by_name(&self, name: &str) -> Option<usize>
pub fn find_pos_by_name(&self, name: &str) -> Option<usize>
Finds the position of a field with name.
pub fn column<'a>(&'a self, col: &'a FieldName) -> Option<&Column>
pub fn project<T>(&self, cols: &[T]) -> Result<Self, RelationError>
Trait Implementations§
source§impl From<AlgebraicType> for Header
impl From<AlgebraicType> for Header
source§fn from(value: AlgebraicType) -> Self
fn from(value: AlgebraicType) -> Self
Converts to this type from the input type.
source§impl From<Header> for ProductType
impl From<Header> for ProductType
source§impl From<ProductType> for Header
impl From<ProductType> for Header
source§fn from(value: ProductType) -> Self
fn from(value: ProductType) -> Self
Converts to this type from the input type.
source§impl Ord for Header
impl Ord for Header
source§impl PartialEq for Header
impl PartialEq for Header
source§impl PartialOrd for Header
impl PartialOrd for Header
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Header
impl StructuralEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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