pub struct Edge {
pub interval: Interval,
pub direction: Direction,
pub weight: FloatType,
pub id: Option<usize>,
/* private fields */
}Expand description
An interval between two nodes, and the way it is walked: music21’s
Edge.
Fields§
§interval: IntervalThe step.
direction: DirectionThe way it is walked, set as connections are added.
weight: FloatTypeCarried for music21’s sake; nothing reads it.
id: Option<usize>Its key in the network, if it has been put in one.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn connect(
&mut self,
from: NodeId,
to: NodeId,
direction: Direction,
) -> Result<()>
pub fn connect( &mut self, from: NodeId, to: NodeId, direction: Direction, ) -> Result<()>
Connects from to to, walked direction: music21’s
addDirectedConnection.
§Errors
Direction::Bi, which is not one way. The connection is kept all
the same, as music21 keeps it.
Sourcepub fn connect_both(&mut self, low: NodeId, high: NodeId)
pub fn connect_both(&mut self, low: NodeId, high: NodeId)
Connects low to high going up and back going down: music21’s
addBiDirectedConnections.
Sourcepub fn connections(&self) -> &[(NodeId, NodeId)]
pub fn connections(&self) -> &[(NodeId, NodeId)]
Every pair of nodes this edge connects, the way up first.
Trait Implementations§
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Forget for Edge
impl Freeze for Edge
impl Move for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more