Struct libreda_pnr::db::Pin [−][src]
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]
S: Into<String>,
Create a new pin with a name and a direction.
pub fn new_input<S>(name: S) -> Pin where
S: Into<String>,
[src]
S: Into<String>,
Convenience function to create a new input pin with a name.
pub fn new_output<S>(name: S) -> Pin where
S: Into<String>,
[src]
S: Into<String>,
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]
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Pin> for Pin
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> TextType for T where
T: Clone + Eq + Debug + Hash,
T: Clone + Eq + Debug + Hash,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,