pub struct Layout {
pub name: String,
pub background: Option<PathBuf>,
pub members: BTreeMap<FixtureId, LayoutPosition>,
pub modes: Vec<LayoutMode>,
}Expand description
A subset of all fixtures in a user definable 2d arrangement.
Layouts may overlap freely. The topology’s default layout is a Layout too,
and is the one that necessarily contains every fixture.
Fields§
§name: String§background: Option<PathBuf>§members: BTreeMap<FixtureId, LayoutPosition>§modes: Vec<LayoutMode>modes[0] is the default mode and is never removed.
Implementations§
Source§impl Layout
impl Layout
Sourcepub const DEFAULT_NAME: &'static str = "Default"
pub const DEFAULT_NAME: &'static str = "Default"
What the layout every fixture belongs to is called. Every collection in patching has a default element, so nothing has to be learned to use one.
pub fn new(name: impl Into<String>) -> Self
pub fn contains(&self, id: FixtureId) -> bool
Sourcepub fn mode(&self, index: usize) -> &LayoutMode
pub fn mode(&self, index: usize) -> &LayoutMode
The mode at index, falling back to the default mode.
pub fn mode_mut(&mut self, index: usize) -> &mut LayoutMode
Sourcepub fn remove_mode(&mut self, index: usize)
pub fn remove_mode(&mut self, index: usize)
Removes a mode. The default mode cannot be removed.
pub fn forget(&mut self, id: FixtureId)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
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
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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,
impl<T> DebugAny for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more