pub struct BlockFun {
language: Rc<RefCell<BlockLanguage>>,
areas: Vec<Box<BlockArea>>,
size_work_dq: VecDeque<usize>,
area_work_dq: VecDeque<usize>,
id_gen: BlockIDGenerator,
generation: u64,
}
Fields
language: Rc<RefCell<BlockLanguage>>
areas: Vec<Box<BlockArea>>
size_work_dq: VecDeque<usize>
area_work_dq: VecDeque<usize>
id_gen: BlockIDGenerator
generation: u64
Implementations
sourceimpl BlockFun
impl BlockFun
pub fn new(lang: Rc<RefCell<BlockLanguage>>) -> Self
pub fn is_unset(&self) -> bool
pub fn block_language(&self) -> Rc<RefCell<BlockLanguage>>
pub fn block_ref(&self, id: usize, x: i64, y: i64) -> Option<&Block>
pub fn block_ref_mut(&mut self, id: usize, x: i64, y: i64) -> Option<&mut Block>
pub fn shift_port(&mut self, id: usize, x: i64, y: i64, row: usize, output: bool)
pub fn save_snapshot(&self) -> BlockFunSnapshot
pub fn load_snapshot(&mut self, repr: &BlockFunSnapshot)
pub fn generate_tree<Node: BlockASTNode>(
&self,
null_typ: &str
) -> Result<Node, BlockDSPError>
pub fn recalculate_area_sizes(&mut self)
pub fn area_is_subarea_of(
&mut self,
area_id: usize,
a_id: usize,
x: i64,
y: i64
) -> bool
pub fn all_sub_areas_of(&mut self, block: &Block, areas: &mut Vec<usize>)
pub fn retrieve_block_chain_at(
&mut self,
id: usize,
x: i64,
y: i64,
remove_blocks: bool
) -> Option<Box<BlockChain>>
pub fn clone_block_from_to(
&mut self,
id: usize,
x: i64,
y: i64,
id2: usize,
x2: i64,
y2: i64
) -> Result<(), BlockDSPError>
pub fn split_block_chain_after(
&mut self,
id: usize,
x: i64,
y: i64,
filler_type: Option<&str>
) -> Result<(), BlockDSPError>
pub fn move_block_chain_from_to(
&mut self,
id: usize,
x: i64,
y: i64,
id2: usize,
x2: i64,
y2: i64
) -> Result<(), BlockDSPError>
pub fn move_block_from_to(
&mut self,
id: usize,
x: i64,
y: i64,
id2: usize,
x2: i64,
y2: i64
) -> Result<(), BlockDSPError>
fn create_areas_for_block(&mut self, block: &mut Block)
pub fn instanciate_at(
&mut self,
id: usize,
x: i64,
y: i64,
typ: &str,
user_input: Option<String>
) -> Result<(), BlockDSPError>
pub fn remove_at(&mut self, id: usize, x: i64, y: i64) -> Result<(), BlockDSPError>
pub fn area_size(&self, id: usize) -> (usize, usize)
pub fn block_at(&self, id: usize, x: i64, y: i64) -> Option<&dyn BlockView>
pub fn origin_at(&self, id: usize, x: i64, y: i64) -> Option<(i64, i64)>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for BlockFun
impl !Send for BlockFun
impl !Sync for BlockFun
impl Unpin for BlockFun
impl !UnwindSafe for BlockFun
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more