Skip to main content

HitObjects

Struct HitObjects 

Source
pub struct HitObjects { /* private fields */ }

Implementations§

Source§

impl HitObjects

Source

pub fn from_str_with_mode(s: &str, mode: &OsuMode) -> Result<Self, String>

Source

pub fn new() -> Self

Source

pub fn add_hit_object(&mut self, hit_object: HitObject)

Source

pub fn count(&self) -> usize

Source

pub fn hit_circle_count(&self) -> usize

Source

pub fn slider_count(&self) -> usize

Source

pub fn spinner_count(&self) -> usize

Source

pub fn start_time(&self) -> Option<f32>

Source

pub fn end_time(&self) -> Option<i32>

Source

pub fn length(&self) -> Option<f32>

Source

pub fn objects_in_time_range( &self, start_time: f32, end_time: f32, ) -> Vec<&HitObject>

Source

pub fn sort_by_time(&mut self)

Source

pub fn to_osu_format(&self) -> String

Source§

impl HitObjects

Source§

impl HitObjects

Source

pub fn iter(&self) -> Iter<'_, HitObject>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, HitObject>

Source

pub fn get(&self, index: usize) -> Option<&HitObject>

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut HitObject>

Source

pub fn get_slice<I>(&self, index: I) -> Option<&I::Output>
where I: SliceIndex<[HitObject]>,

Source

pub fn get_slice_mut<I>(&mut self, index: I) -> Option<&mut I::Output>
where I: SliceIndex<[HitObject], Output = [HitObject]>,

Source

pub fn is_empty(&self) -> bool

Source

pub fn first(&self) -> Option<&HitObject>

Source

pub fn last(&self) -> Option<&HitObject>

Source

pub fn first_mut(&mut self) -> Option<&mut HitObject>

Source

pub fn last_mut(&mut self) -> Option<&mut HitObject>

Trait Implementations§

Source§

impl Clone for HitObjects

Source§

fn clone(&self) -> HitObjects

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HitObjects

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HitObjects

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FromStr for HitObjects

Source§

type Err = String

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<I> Index<I> for HitObjects
where I: SliceIndex<[HitObject]>,

Source§

type Output = <I as SliceIndex<[HitObject]>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I> IndexMut<I> for HitObjects
where I: SliceIndex<[HitObject], Output = [HitObject]>,

Source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IntoIterator for HitObjects

Source§

type Item = HitObject

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<HitObject>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a HitObjects

Source§

type Item = &'a HitObject

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, HitObject>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut HitObjects

Source§

type Item = &'a mut HitObject

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, HitObject>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for HitObjects

Source§

fn eq(&self, other: &HitObjects) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for HitObjects

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.