pub struct Stream { /* private fields */ }Expand description
A small ordered stream of notes, chords, and rests.
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn from_events(events: impl IntoIterator<Item = StreamEvent>) -> Self
pub fn from_events(events: impl IntoIterator<Item = StreamEvent>) -> Self
Creates a stream from events, sorted by offset.
Sourcepub fn insert(&mut self, offset: FloatType, element: impl Into<StreamElement>)
pub fn insert(&mut self, offset: FloatType, element: impl Into<StreamElement>)
Inserts an element at a quarter-length offset.
Sourcepub fn push(&mut self, element: impl Into<StreamElement>)
pub fn push(&mut self, element: impl Into<StreamElement>)
Appends an element after the current end of the stream.
Sourcepub fn events(&self) -> &[StreamEvent]
pub fn events(&self) -> &[StreamEvent]
Returns immutable events in offset order.
Sourcepub fn iter(&self) -> impl Iterator<Item = &StreamEvent>
pub fn iter(&self) -> impl Iterator<Item = &StreamEvent>
Iterates over events in offset order.
Sourcepub fn end_offset(&self) -> FloatType
pub fn end_offset(&self) -> FloatType
Returns the maximum event end offset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stream
impl<'de> Deserialize<'de> for Stream
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
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