Struct scribl_curves::Cursor [−][src]
A cursor allows for efficiently scanning through a collection of overlapping intervals (which
we call "spans"). It is optimized for the case where you need to repeatedly move the current
position by a little bit in either direction; in this case, the complexity is O(n),
where n
is the number of "active" spans that overlap the times you're interested in.
Implementations
impl Cursor<Time, DrawSnippetId>
[src]
pub fn bboxes<'a, 'b: 'a, 'c: 'a>(
&'b self,
snippets: &'c DrawSnippets
) -> impl Iterator<Item = Rect> + 'a
[src]
&'b self,
snippets: &'c DrawSnippets
) -> impl Iterator<Item = Rect> + 'a
impl<T: Ord + Copy, Id: Copy + Eq> Cursor<T, Id>
[src]
pub fn new<I: IntoIterator<Item = Span<T, Id>>>(
spans: I,
start_time: T,
end_time: T
) -> Cursor<T, Id>
[src]
spans: I,
start_time: T,
end_time: T
) -> Cursor<T, Id>
Creates a new cursor for the given set of spans, and initializes its current position to
be the interval [start_time, end_time]
(inclusive of both ends).
pub fn empty(time: T) -> Cursor<T, Id>
[src]
Creates a cursor with no spans, set to the time interval [time, time]
.
pub fn current(&self) -> (T, T)
[src]
Returns this cursors current time interval.
pub fn advance_to(&mut self, start_time: T, end_time: T)
[src]
pub fn active_ids<'a>(&'a self) -> impl Iterator<Item = Id> + 'a
[src]
pub fn active_spans<'a>(&'a self) -> impl Iterator<Item = Span<T, Id>> + 'a
[src]
pub fn is_finished(&self) -> bool
[src]
Trait Implementations
Auto Trait Implementations
impl<T, Id> RefUnwindSafe for Cursor<T, Id> where
Id: RefUnwindSafe,
T: RefUnwindSafe,
[src]
Id: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Id> Send for Cursor<T, Id> where
Id: Send,
T: Send,
[src]
Id: Send,
T: Send,
impl<T, Id> Sync for Cursor<T, Id> where
Id: Sync,
T: Sync,
[src]
Id: Sync,
T: Sync,
impl<T, Id> Unpin for Cursor<T, Id> where
Id: Unpin,
T: Unpin,
[src]
Id: Unpin,
T: Unpin,
impl<T, Id> UnwindSafe for Cursor<T, Id> where
Id: UnwindSafe,
T: UnwindSafe,
[src]
Id: UnwindSafe,
T: UnwindSafe,
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> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,