Struct debris_backends::datapack::function_context::FunctionContext
source · pub(super) struct FunctionContext {
functions: IndexMap<Rc<FunctionIdent>, Option<BuildingFunction>>,
block_id_mapping: FxHashMap<BlockId, FunctionId>,
current_function_id: usize,
namespace: Rc<str>,
}
Fields§
§functions: IndexMap<Rc<FunctionIdent>, Option<BuildingFunction>>
§block_id_mapping: FxHashMap<BlockId, FunctionId>
§current_function_id: usize
§namespace: Rc<str>
The debris namespace
Implementations§
source§impl FunctionContext
impl FunctionContext
pub fn new(main_namespace: Rc<str>) -> Self
pub fn into_functions( self ) -> impl Iterator<Item = (Rc<FunctionIdent>, Vec<MinecraftCommand>)>
pub fn reserve_at(&mut self, function_location: &FunctionLocation) -> FunctionId
pub fn reserve(&mut self) -> FunctionId
pub fn reserve_block(&mut self, block_id: BlockId) -> FunctionId
pub fn insert( &mut self, id: FunctionId, commands: impl Iterator<Item = MinecraftCommand> )
pub fn append_to_fn(&mut self, id: FunctionId, command: MinecraftCommand)
pub fn get_function_id(&self, block_id: BlockId) -> Option<FunctionId>
pub fn get_function_id_from_ident(&self, ident: &FunctionIdent) -> FunctionId
pub fn get_function_ident(&self, function_id: FunctionId) -> Rc<FunctionIdent>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for FunctionContext
impl !Send for FunctionContext
impl !Sync for FunctionContext
impl Unpin for FunctionContext
impl UnwindSafe for FunctionContext
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