Skip to main content

Layout

Struct Layout 

Source
pub struct Layout {
    pub id: String,
    pub name: String,
    pub kind: &'static str,
    pub flip_y: bool,
    pub nodes: BTreeMap<usize, (f64, f64)>,
    pub edges: BTreeMap<usize, Vec<(f64, f64)>>,
    pub sizes: BTreeMap<usize, (f64, f64)>,
    pub unit: Option<f64>,
    pub tracks: BTreeMap<usize, i32>,
}
Expand description

Positions of nodes and routes of edges, in one diagram (DL) or one coordinate system (GL), as the data writes them.

Fields§

§id: String§name: String§kind: &'static str

diagram (x right, y as flip_y says) or geographic (x longitude, y latitude, in degrees).

§flip_y: bool

A diagram whose y grows upwards (OrientationKind.positive).

§nodes: BTreeMap<usize, (f64, f64)>

Node index → position.

§edges: BTreeMap<usize, Vec<(f64, f64)>>

Edge index → its route, from its source’s end to its target’s.

§sizes: BTreeMap<usize, (f64, f64)>

Node index → its width and height, where the layout sizes it (a busbar, as long as the bays it joins).

§unit: Option<f64>

Pixels per unit, where the positions are to be drawn as they are; None, to be scaled to fit.

§tracks: BTreeMap<usize, i32>

Edge index → how many line spacings aside it runs from its route, to the left of its way (negative: right); the views space them in pixels.

Trait Implementations§

Source§

impl Debug for Layout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Layout

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Layout

§

impl Freeze for Layout
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze, *const LeafNode<usize, (f64, f64)> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(usize, (f64, f64))>>: Freeze, *const LeafNode<usize, Vec<(f64, f64)>> is !null: Freeze, PhantomData<Box<(usize, Vec<(f64, f64)>)>>: Freeze, *const LeafNode<usize, i32> is !null: Freeze, PhantomData<Box<(usize, i32)>>: Freeze,

§

impl Move for Layout

§

impl RefUnwindSafe for Layout

§

impl Send for Layout
where RawVecInner: Send, &'static str: Send, NodeRef<Owned, usize, (f64, f64), LeafOrInternal>: Send, BoxRaw<(usize, (f64, f64))>: Send, NodeRef<Owned, usize, Vec<(f64, f64)>, LeafOrInternal>: Send, BoxRaw<(usize, Vec<(f64, f64)>)>: Send, NodeRef<Owned, usize, i32, LeafOrInternal>: Send, BoxRaw<(usize, i32)>: Send,

§

impl Sync for Layout
where RawVecInner: Sync, NodeRef<Owned, usize, (f64, f64), LeafOrInternal>: Sync, BoxRaw<(usize, (f64, f64))>: Sync, NodeRef<Owned, usize, Vec<(f64, f64)>, LeafOrInternal>: Sync, BoxRaw<(usize, Vec<(f64, f64)>)>: Sync, NodeRef<Owned, usize, i32, LeafOrInternal>: Sync, BoxRaw<(usize, i32)>: Sync,

§

impl Unpin for Layout
where *const u8 is !null: Unpin, &'static str: Unpin, *const LeafNode<usize, (f64, f64)> is !null: Unpin, Box<(usize, (f64, f64))>: Unpin, *const LeafNode<usize, Vec<(f64, f64)>> is !null: Unpin, Box<(usize, Vec<(f64, f64)>)>: Unpin, *const LeafNode<usize, i32> is !null: Unpin, Box<(usize, i32)>: Unpin,

§

impl UnsafeUnpin for Layout
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, &'static str: UnsafeUnpin, *const LeafNode<usize, (f64, f64)> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(usize, (f64, f64))>>: UnsafeUnpin, *const LeafNode<usize, Vec<(f64, f64)>> is !null: UnsafeUnpin, PhantomData<Box<(usize, Vec<(f64, f64)>)>>: UnsafeUnpin, *const LeafNode<usize, i32> is !null: UnsafeUnpin, PhantomData<Box<(usize, i32)>>: UnsafeUnpin,

§

impl UnwindSafe for Layout

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.