pub enum TimePoint {
Seconds(f64),
Spec(String),
}Expand description
A point in time: a bare JSON number of seconds, or a small string expression anchored to the beat grid.
§Grammar (for the Spec string form)
An optional leading @ (forces the value onto the scenario’s absolute
timeline — see the module doc), followed by one or more terms joined by
+ or -. Each term is <number><unit>, where unit is one of:
s— seconds, taken as-is.ms— milliseconds, divided by 1000.b— beats:beat_offset + n * 60 / bpm(errors withTimeError::NoBpmwhen the scenario declares nobpm). A term’s sign multiplies this whole grid position,beat_offsetincluded — so"@2.2s-1b"is “2.2s before wherever beat 1 lands,” not “1 raw beat length before 2.2s.”
Valid examples: "2.5s", "8b", "120ms", "8b+120ms", "@8b",
"@2.2s-1b".
Variants§
Seconds(f64)
A bare JSON number: seconds, always relative to whatever context
resolves it (see TimePoint::resolve_relative).
Spec(String)
The string expression form — see the grammar above.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimePoint
impl<'de> Deserialize<'de> for TimePoint
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
Source§impl JsonSchema for TimePoint
impl JsonSchema for TimePoint
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for TimePoint
Auto Trait Implementations§
impl Freeze for TimePoint
impl RefUnwindSafe for TimePoint
impl Send for TimePoint
impl Sync for TimePoint
impl Unpin for TimePoint
impl UnsafeUnpin for TimePoint
impl UnwindSafe for TimePoint
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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