pub struct Module {
pub id: Uuid,
pub module_type: ModuleType,
pub name: String,
pub routines: IndexMap<Uuid, Routine>,
pub player: bool,
pub view_name: String,
/* private fields */
}Fields§
§id: Uuid§module_type: ModuleType§name: String§routines: IndexMap<Uuid, Routine>§player: bool§view_name: StringImplementations§
Source§impl Module
impl Module
Sourcepub fn replace_preserving_runtime(&mut self, next: &Module)
pub fn replace_preserving_runtime(&mut self, next: &Module)
Replace persisted module data while keeping runtime-only UI state (selection, scroll, view binding, filter text) intact.
Sourcepub fn clear_toolbar_settings(&self, ui: &mut TheUI, ctx: &mut TheContext)
pub fn clear_toolbar_settings(&self, ui: &mut TheUI, ctx: &mut TheContext)
Reset toolbar to filter-only controls (drops any stale value widgets).
pub fn new(name: &str) -> Self
pub fn as_type(t: ModuleType) -> Self
Sourcepub fn set_module_type(&mut self, module_type: ModuleType)
pub fn set_module_type(&mut self, module_type: ModuleType)
Sets the module type
Sourcepub fn update_routines(&mut self)
pub fn update_routines(&mut self)
Add/ Update the routines of the module
Sourcepub fn build_canvas(&mut self, ctx: &mut TheContext, name: &str) -> TheCanvas
pub fn build_canvas(&mut self, ctx: &mut TheContext, name: &str) -> TheCanvas
Read out the colors out of the style.
pub fn build_item_list( &self, list: &mut dyn TheListLayoutTrait, ctx: &mut TheContext, )
pub fn draw(&mut self, buffer: &mut TheRGBABuffer)
pub fn redraw(&mut self, ui: &mut TheUI, ctx: &TheContext)
pub fn redraw_debug( &mut self, ui: &mut TheUI, ctx: &TheContext, id: u32, debug: &DebugModule, )
Sourcepub fn get_selected_routine_mut(&mut self) -> Option<&mut Routine>
pub fn get_selected_routine_mut(&mut self) -> Option<&mut Routine>
Returns the selected routine
Sourcepub fn insert_module(&mut self, module: &Module, coord: Vec2<i32>) -> bool
pub fn insert_module(&mut self, module: &Module, coord: Vec2<i32>) -> bool
Copy a library module into the routine t the given position.
Sourcepub fn handle_event(
&mut self,
event: &TheEvent,
ui: &mut TheUI,
ctx: &mut TheContext,
palette: &ThePalette,
) -> bool
pub fn handle_event( &mut self, event: &TheEvent, ui: &mut TheUI, ctx: &mut TheContext, palette: &ThePalette, ) -> bool
Handle events
Sourcepub fn show_settings(&mut self, ui: &mut TheUI, ctx: &mut TheContext)
pub fn show_settings(&mut self, ui: &mut TheUI, ctx: &mut TheContext)
Refresh the current toolbar settings from the selected cell or event.
Sourcepub fn set_shader_background(
&mut self,
buffer: TheRGBABuffer,
ui: &mut TheUI,
ctx: &TheContext,
)
pub fn set_shader_background( &mut self, buffer: TheRGBABuffer, ui: &mut TheUI, ctx: &TheContext, )
Set the backround for a shader
Sourcepub fn build_shader(&self) -> String
pub fn build_shader(&self) -> String
Build shader code
Sourcepub fn build_custom_shader(&self, name: &str) -> String
pub fn build_custom_shader(&self, name: &str) -> String
Build shader code: ceiling
Sourcepub fn get_view_name(&self) -> String
pub fn get_view_name(&self) -> String
Returns the view name for the module type
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Module
impl<'de> Deserialize<'de> for Module
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 Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().