pub struct Layout { /* private fields */ }Implementations§
Source§impl Layout
impl Layout
pub fn empty(own_id: MachineId) -> Self
pub fn version(&self) -> u64
pub fn by(&self) -> MachineId
pub fn placements(&self) -> &[Placement]
Sourcepub fn nth(
&self,
n: u8,
eligible: impl Fn(MachineId) -> bool,
) -> Option<MachineId>
pub fn nth( &self, n: u8, eligible: impl Fn(MachineId) -> bool, ) -> Option<MachineId>
One-based machine number, ordered top to bottom, then left to right. Ineligible placements keep their numbers but cannot be selected.
Sourcepub fn edit(
&self,
placements: Vec<Placement>,
own_id: MachineId,
) -> Result<Self, LayoutError>
pub fn edit( &self, placements: Vec<Placement>, own_id: MachineId, ) -> Result<Self, LayoutError>
§Errors
Rejects invalid placements and an exhausted version counter.
pub fn merge(&mut self, incoming: Self, own_id: MachineId) -> Merge
pub fn to_proto(&self) -> Layout
Trait Implementations§
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layout
impl Move 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