Skip to main content

ProgramDiagram

Struct ProgramDiagram 

Source
pub struct ProgramDiagram<Roster: DescribeRoster> { /* private fields */ }
Expand description

Experimental development scaffolding; not ready for application consumption.

A compiled program boundary view. Routing remains the board’s runtime decision. Rendered type labels abbreviate paths; accessors retain compiler-qualified names.

Equal-looking roles do not make two rosters interchangeable:

ⓘ
use pipecircuit::{Pipe, Switchboard};
use pipecircuit_visualization::ProgramDiagram;
struct Protocol;
impl Pipe for Protocol { type In<'a> = (); type Out<'a> = (); }
pipecircuit::pipe_roster! { mod first { client: super::Protocol } }
pipecircuit::pipe_roster! { mod second { client: super::Protocol } }
struct Board;
impl Switchboard for Board {
    type From<'a> = first::From<'a>;
    type To<'a> = first::To<'a>;
    fn route<'a>(&mut self, from: Self::From<'a>) -> Self::To<'a> {
        match from { first::From::Client(()) => first::To::Client(()) }
    }
}
let mismatched = ProgramDiagram::<second::Schema>::for_board::<Board>();

Implementations§

Source§

impl<Roster: DescribeRoster> ProgramDiagram<Roster>

Source

pub fn for_board<Board: Switchboard>() -> Self
where Roster: for<'a> PipeRoster<From<'a> = Board::From<'a>, To<'a> = Board::To<'a>>,

Source

pub fn board(&self) -> &'static str

Source

pub fn pipes(&self) -> &[PipeDescription]

Source

pub fn render_html(&self) -> String

A standalone browser view with expandable declarations and an optional physical layer. No scripts, network resources or live runtime polling.

Source

pub fn render(&self, target: DiagramTarget) -> String

Source

pub fn installed<Bindings: DescribeBindings<Roster = Roster>>( &self, bindings: &Bindings, ) -> InstallationDiagram

The binding inventory must name this exact roster; unrelated installations cannot be combined merely because their fields have equal spellings.

Auto Trait Implementations§

§

impl<Roster> Freeze for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: Freeze,

§

impl<Roster> RefUnwindSafe for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: RefUnwindSafe,

§

impl<Roster> Send for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: Send,

§

impl<Roster> Sync for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: Sync,

§

impl<Roster> Unpin for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: Unpin,

§

impl<Roster> UnsafeUnpin for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: UnsafeUnpin,

§

impl<Roster> UnwindSafe for ProgramDiagram<Roster>
where PhantomData<fn() -> Roster>: UnwindSafe,

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.