Skip to main content

Connector

Struct Connector 

Source
pub struct Connector {
    pub from: Endpoint,
    pub to: Endpoint,
    pub stroke: Stroke,
}
Expand description

A connector: two endpoints and a stroke.

A complete shape in the sense of Complete and fragment in docs/model.md. The route between the two endpoints is derived from their positions and leaving directions alone, and is never described by the caller.

Fields§

§from: Endpoint

One endpoint of the connector.

§to: Endpoint

The other endpoint of the connector.

§stroke: Stroke

The stroke the route between the two endpoints is drawn in, and the stroke an arm terminal is written in. A glyph or symbol terminal is drawn as its own cell, not in this stroke.

Trait Implementations§

Source§

impl Debug for Connector

Source§

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

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

impl Shape for Connector

Source§

fn draw(&self, surface: &mut dyn Surface)

Draws the two terminals and then the route, in that order. The order of the two terminals is the order the endpoints are named, from then to, and it is load-bearing where two endpoints share one position: under Above the second is the one seen.

The route is derived from the two positions and the two leaving directions alone, so it is called exactly as it always was and a terminal cannot reach it.

Auto Trait Implementations§

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, 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.