Skip to main content

Grid

Struct Grid 

Source
pub struct Grid {
    pub nodes: Vec<Node>,
    pub edges: Vec<Edge>,
    pub elsewhere: Counts,
    pub layouts: Vec<Layout>,
    pub auto: Option<Layout>,
    pub inside: FastMap<usize, Inside>,
    /* private fields */
}

Fields§

§nodes: Vec<Node>§edges: Vec<Edge>§elsewhere: Counts

Findings on objects with no node or edge (headers, regions, …).

§layouts: Vec<Layout>

Positions from the DL diagrams and GL coordinate systems.

§auto: Option<Layout>

Positions laid out here (crate::layout::force), for the view’s automatic layout: the view’s own is quadratic, and this one is the same each time.

§inside: FastMap<usize, Inside>

What each substation holds, by node index.

Implementations§

Source§

impl Grid

Source

pub fn add_findings(&mut self, violations: &[(Option<usize>, Violation)])

Count each finding on its object’s node or edge.

Source

pub fn reveal(&self, id: &str) -> Option<Value>

Where the view shows object id: select, the node or edge it is on, else the item it stands for inside enter, its substation; and inside, a substation’s own id. None if it is on neither.

Source

pub fn json(&self, set: &impl Locations) -> Value

The view’s data: nodes and edges, each with where it is written.

Source

pub fn inside_json(&self, set: &impl Locations, id: &str) -> Option<Value>

What the substation id holds, for the view’s drill-down; None if no substation of the set has that mRID.

Trait Implementations§

Source§

impl Debug for Grid

Source§

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

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

impl Default for Grid

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for Grid

§

impl Freeze for Grid

§

impl Move for Grid

§

impl RefUnwindSafe for Grid

§

impl Send for Grid

§

impl Sync for Grid

§

impl Unpin for Grid

§

impl UnsafeUnpin for Grid

§

impl UnwindSafe for Grid

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.