Struct libreda_pnr::db::Pin[][src]

pub struct Pin { /* fields omitted */ }

Definition of a pin into a circuit. TODO: Make multi-bit capable.

Implementations

impl Pin[src]

pub fn new<S>(name: S, direction: Direction) -> Pin where
    S: Into<String>, 
[src]

Create a new pin with a name and a direction.

pub fn new_input<S>(name: S) -> Pin where
    S: Into<String>, 
[src]

Convenience function to create a new input pin with a name.

pub fn new_output<S>(name: S) -> Pin where
    S: Into<String>, 
[src]

Convenience function to create a new output pin with a name.

pub fn name(&self) -> &String[src]

Get the name of the pin.

pub fn direction(&self) -> Direction[src]

Return the input/output direction of the pin.

pub fn set_direction(&self, direction: Direction) -> Direction[src]

Set a new pin direction and return the old one.

pub fn id(&self) -> usize[src]

Get the ID of the pin.

pub fn connect_net(&self, net: Option<Rc<Net>>) -> Option<Rc<Net>>[src]

Connect the pin to the given net or disconnect it if None is given as a net. This is a shortcut for calling connect_pin_by_id on the parent circuit instance. Returns the previously connected net.

Panics

Panics if the parent circuit does not exist anymore. TODO: Remove this and use the connect_pin function on the parent circuit?

pub fn disconnect_net(&self) -> Option<Rc<Net>>[src]

Disconnect the pin from the internal net. This is a shortcut for calling connect_pin_by_id on the parent circuit instance. Returns the previously connected net. TODO: Remove this and use the connect_pin function on the parent circuit?

pub fn internal_net(&self) -> Option<Rc<Net>>[src]

Get the net that is internally connected to this pin, if any.

pub fn parent_circuit(&self) -> Weak<Circuit>[src]

Get the circuit where this net lives in.

Trait Implementations

impl Clone for Pin[src]

impl Debug for Pin[src]

impl Eq for Pin[src]

impl Hash for Pin[src]

impl PartialEq<Pin> for Pin[src]

pub fn eq(&self, other: &Pin) -> bool[src]

Pins are considered equal if they have the same parent circuit and the same ID number.

Auto Trait Implementations

impl !RefUnwindSafe for Pin

impl !Send for Pin

impl !Sync for Pin

impl Unpin for Pin

impl !UnwindSafe for Pin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> TextType for T where
    T: Clone + Eq + Debug + Hash

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.