Struct mech_core::Block

source ·
pub struct Block {
Show 19 fields pub id: BlockId, pub ast: AstNode, pub state: BlockState, pub tables: Database, pub plan: Plan, pub functions: Option<Rc<RefCell<Functions>>>, pub user_functions: Option<Rc<RefCell<HashMap<u64, UserFunction>>>>, pub global_database: Rc<RefCell<Database>>, pub unsatisfied_transformation: Option<(MechError, Transformation)>, pub pending_transformations: Vec<Transformation>, pub pending_global_tables: HashMap<u64, TableRef>, pub transformations: Vec<Transformation>, pub defined_tables: HashSet<(TableId, RegisterIndex, RegisterIndex)>, pub required_functions: HashSet<u64>, pub strings: StringDictionary, pub triggers: HashSet<(TableId, RegisterIndex, RegisterIndex)>, pub input: HashSet<(TableId, RegisterIndex, RegisterIndex)>, pub output: HashSet<(TableId, RegisterIndex, RegisterIndex)>, pub dynamic_tables: HashSet<(TableId, RegisterIndex, RegisterIndex)>,
}

Fields§

§id: BlockId§ast: AstNode§state: BlockState§tables: Database§plan: Plan§functions: Option<Rc<RefCell<Functions>>>§user_functions: Option<Rc<RefCell<HashMap<u64, UserFunction>>>>§global_database: Rc<RefCell<Database>>§unsatisfied_transformation: Option<(MechError, Transformation)>§pending_transformations: Vec<Transformation>§pending_global_tables: HashMap<u64, TableRef>§transformations: Vec<Transformation>§defined_tables: HashSet<(TableId, RegisterIndex, RegisterIndex)>§required_functions: HashSet<u64>§strings: StringDictionary§triggers: HashSet<(TableId, RegisterIndex, RegisterIndex)>§input: HashSet<(TableId, RegisterIndex, RegisterIndex)>§output: HashSet<(TableId, RegisterIndex, RegisterIndex)>§dynamic_tables: HashSet<(TableId, RegisterIndex, RegisterIndex)>

Implementations§

source§

impl Block

source

pub fn new() -> Block

source

pub fn get_table( &self, table_id: &TableId, ) -> Result<Rc<RefCell<Table>>, MechError>

source

pub fn gen_id(&mut self) -> BlockId

source

pub fn id(&self) -> BlockId

source

pub fn recompile(&mut self) -> Result<(), MechError>

source

pub fn ready(&mut self) -> Result<(), MechError>

source

pub fn get_arg_column( &self, argument: &Argument, ) -> Result<(u64, Column, ColumnIndex), MechError>

source

pub fn get_arg_columns( &self, arguments: &Vec<Argument>, ) -> Result<Vec<(u64, Column, ColumnIndex)>, MechError>

source

pub fn get_whole_table_arg_cols( &self, argument: &Argument, ) -> Result<Vec<(u64, Column, ColumnIndex)>, MechError>

source

pub fn get_out_column( &self, out: &Out, rows: usize, col_kind: ValueKind, ) -> Result<Column, MechError>

source

pub fn get_arg_dims( &self, arguments: &Vec<Argument>, ) -> Result<Vec<TableShape>, MechError>

source

pub fn get_arg_dim(&self, argument: &Argument) -> Result<TableShape, MechError>

source

pub fn add_tfm(&mut self, tfm: Transformation) -> Result<(), MechError>

source

pub fn solve(&self) -> Result<(), MechError>

Trait Implementations§

source§

impl Clone for Block

source§

fn clone(&self) -> Block

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Block

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Block

§

impl !RefUnwindSafe for Block

§

impl !Send for Block

§

impl !Sync for Block

§

impl Unpin for Block

§

impl !UnwindSafe for Block

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V