pub struct Table {
pub schema: TableSchema,
pub rows: HashMap<RowId, Row>,
pub next_row_id: u64,
}Expand description
表数据容器
Fields§
§schema: TableSchema§rows: HashMap<RowId, Row>§next_row_id: u64Implementations§
Source§impl Table
impl Table
pub fn new(schema: TableSchema) -> Self
pub fn insert(&mut self, row: Row) -> RowId
pub fn get(&self, row_id: RowId) -> Option<&Row>
pub fn get_mut(&mut self, row_id: RowId) -> Option<&mut Row>
pub fn remove(&mut self, row_id: RowId) -> Option<Row>
pub fn iter(&self) -> impl Iterator<Item = (RowId, &Row)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (RowId, &mut Row)>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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