pub struct Local<'s, T>(/* private fields */)
where
T: FromWorld + Send + 'static;
Expand description
A system local SystemParam
.
A local may only be accessed by the system itself and is therefore not visible to other systems.
If two or more systems specify the same local type each will have their own unique local.
If multiple SystemParam
s within the same system each specify the same local type
each will get their own distinct data storage.
The supplied lifetime parameter is the SystemParam
s 's
lifetime.
§Examples
fn write_to_local(mut local: Local<usize>) {
*local = 42;
}
fn read_from_local(local: Local<usize>) -> usize {
*local
}
let mut write_system = IntoSystem::into_system(write_to_local);
let mut read_system = IntoSystem::into_system(read_from_local);
write_system.initialize(world);
read_system.initialize(world);
assert_eq!(read_system.run((), world), 0);
write_system.run((), world);
// Note how the read local is still 0 due to the locals not being shared.
assert_eq!(read_system.run((), world), 0);
A simple way to set a different default value for a local is by wrapping the value with an Option.
fn counter_from_10(mut count: Local<Option<usize>>) -> usize {
let count = count.get_or_insert(10);
*count += 1;
*count
}
let mut counter_system = IntoSystem::into_system(counter_from_10);
counter_system.initialize(world);
// Counter is initialized at 10, and increases to 11 on first run.
assert_eq!(counter_system.run((), world), 11);
// Counter is only increased by 1 on subsequent runs.
assert_eq!(counter_system.run((), world), 12);
N.B. A Local
s value cannot be read or written to outside of the containing system.
To add configuration to a system, convert a capturing closure into the system instead:
struct Config(u32);
#[derive(Resource)]
struct MyU32Wrapper(u32);
fn reset_to_system(value: Config) -> impl FnMut(ResMut<MyU32Wrapper>) {
move |mut val| val.0 = value.0
}
// .add_systems(reset_to_system(my_config))
Trait Implementations§
Source§impl<'_s, T> ExclusiveSystemParam for Local<'_s, T>
impl<'_s, T> ExclusiveSystemParam for Local<'_s, T>
Source§type Item<'s> = Local<'s, T>
type Item<'s> = Local<'s, T>
The item type returned when constructing this system param.
See
SystemParam::Item
.Source§fn init(
world: &mut World,
_system_meta: &mut SystemMeta,
) -> <Local<'_s, T> as ExclusiveSystemParam>::State
fn init( world: &mut World, _system_meta: &mut SystemMeta, ) -> <Local<'_s, T> as ExclusiveSystemParam>::State
Creates a new instance of this param’s
State
.Source§fn get_param<'s>(
state: &'s mut <Local<'_s, T> as ExclusiveSystemParam>::State,
_system_meta: &SystemMeta,
) -> <Local<'_s, T> as ExclusiveSystemParam>::Item<'s>
fn get_param<'s>( state: &'s mut <Local<'_s, T> as ExclusiveSystemParam>::State, _system_meta: &SystemMeta, ) -> <Local<'_s, T> as ExclusiveSystemParam>::Item<'s>
Creates a parameter to be passed into an
ExclusiveSystemParamFunction
.Source§impl<'s, 'a, T> IntoIterator for &'a Local<'s, T>
impl<'s, 'a, T> IntoIterator for &'a Local<'s, T>
Source§impl<'s, 'a, T> IntoIterator for &'a mut Local<'s, T>
impl<'s, 'a, T> IntoIterator for &'a mut Local<'s, T>
Source§impl<'a, T> SystemParam for Local<'a, T>
impl<'a, T> SystemParam for Local<'a, T>
Source§type Item<'w, 's> = Local<'s, T>
type Item<'w, 's> = Local<'s, T>
The item type returned when constructing this system param.
The value of this associated type should be
Self
, instantiated with new lifetimes. Read moreSource§fn init_state(
world: &mut World,
_system_meta: &mut SystemMeta,
) -> <Local<'a, T> as SystemParam>::State
fn init_state( world: &mut World, _system_meta: &mut SystemMeta, ) -> <Local<'a, T> as SystemParam>::State
Registers any
World
access used by this SystemParam
and creates a new instance of this param’s State
.Source§unsafe fn get_param<'w, 's>(
state: &'s mut <Local<'a, T> as SystemParam>::State,
_system_meta: &SystemMeta,
_world: UnsafeWorldCell<'w>,
_change_tick: Tick,
) -> <Local<'a, T> as SystemParam>::Item<'w, 's>
unsafe fn get_param<'w, 's>( state: &'s mut <Local<'a, T> as SystemParam>::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'w>, _change_tick: Tick, ) -> <Local<'a, T> as SystemParam>::Item<'w, 's>
Creates a parameter to be passed into a
SystemParamFunction
. Read moreSource§unsafe fn new_archetype(
state: &mut Self::State,
archetype: &Archetype,
system_meta: &mut SystemMeta,
)
unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta, )
For the specified
Archetype
, registers the components accessed by this SystemParam
(if applicable).a Read moreSource§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
Applies any deferred mutations stored in this
SystemParam
’s state.
This is used to apply Commands
during ApplyDeferred
.Source§fn queue(
state: &mut Self::State,
system_meta: &SystemMeta,
world: DeferredWorld<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
Queues any deferred mutations to be applied at the next
ApplyDeferred
.Source§unsafe fn validate_param(
state: &Self::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'_>,
) -> Result<(), SystemParamValidationError>
unsafe fn validate_param( state: &Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'_>, ) -> Result<(), SystemParamValidationError>
Source§impl<'s, T> SystemParamBuilder<Local<'s, T>> for LocalBuilder<T>
impl<'s, T> SystemParamBuilder<Local<'s, T>> for LocalBuilder<T>
Source§fn build(
self,
_world: &mut World,
_meta: &mut SystemMeta,
) -> <Local<'s, T> as SystemParam>::State
fn build( self, _world: &mut World, _meta: &mut SystemMeta, ) -> <Local<'s, T> as SystemParam>::State
Registers any
World
access used by this SystemParam
and creates a new instance of this param’s State
.Source§fn build_state(self, world: &mut World) -> SystemState<P>
fn build_state(self, world: &mut World) -> SystemState<P>
Create a
SystemState
from a SystemParamBuilder
.
To create a system, call SystemState::build_system
on the result.impl<'s, T> ReadOnlySystemParam for Local<'s, T>
Auto Trait Implementations§
impl<'s, T> Freeze for Local<'s, T>
impl<'s, T> RefUnwindSafe for Local<'s, T>where
T: RefUnwindSafe,
impl<'s, T> Send for Local<'s, T>
impl<'s, T> Sync for Local<'s, T>where
T: Sync,
impl<'s, T> Unpin for Local<'s, T>
impl<'s, T> !UnwindSafe for Local<'s, T>
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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, C, D> Curve<T> for D
impl<T, C, D> Curve<T> for D
Source§fn sample_unchecked(&self, t: f32) -> T
fn sample_unchecked(&self, t: f32) -> T
Sample a point on this curve at the parameter value
t
, extracting the associated value.
This is the unchecked version of sampling, which should only be used if the sample time t
is already known to lie within the curve’s domain. Read moreSource§fn sample(&self, t: f32) -> Option<T>
fn sample(&self, t: f32) -> Option<T>
Sample a point on this curve at the parameter value
t
, returning None
if the point is
outside of the curve’s domain.Source§fn sample_clamped(&self, t: f32) -> T
fn sample_clamped(&self, t: f32) -> T
Sample a point on this curve at the parameter value
t
, clamping t
to lie inside the
domain of the curve.Source§impl<C, T> CurveExt<T> for Cwhere
C: Curve<T>,
impl<C, T> CurveExt<T> for Cwhere
C: Curve<T>,
Source§fn sample_iter(
&self,
iter: impl IntoIterator<Item = f32>,
) -> impl Iterator<Item = Option<T>>
fn sample_iter( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = Option<T>>
Sample a collection of
n >= 0
points on this curve at the parameter values t_n
,
returning None
if the point is outside of the curve’s domain. Read moreSource§fn sample_iter_unchecked(
&self,
iter: impl IntoIterator<Item = f32>,
) -> impl Iterator<Item = T>
fn sample_iter_unchecked( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = T>
Sample a collection of
n >= 0
points on this curve at the parameter values t_n
,
extracting the associated values. This is the unchecked version of sampling, which should
only be used if the sample times t_n
are already known to lie within the curve’s domain. Read moreSource§fn sample_iter_clamped(
&self,
iter: impl IntoIterator<Item = f32>,
) -> impl Iterator<Item = T>
fn sample_iter_clamped( &self, iter: impl IntoIterator<Item = f32>, ) -> impl Iterator<Item = T>
Sample a collection of
n >= 0
points on this curve at the parameter values t_n
,
clamping t_n
to lie inside the domain of the curve. Read moreSource§fn map<S, F>(self, f: F) -> MapCurve<T, S, Self, F>where
F: Fn(T) -> S,
fn map<S, F>(self, f: F) -> MapCurve<T, S, Self, F>where
F: Fn(T) -> S,
Create a new curve by mapping the values of this curve via a function
f
; i.e., if the
sample at time t
for this curve is x
, the value at time t
on the new curve will be
f(x)
.Source§fn reparametrize<F>(self, domain: Interval, f: F) -> ReparamCurve<T, Self, F>
fn reparametrize<F>(self, domain: Interval, f: F) -> ReparamCurve<T, Self, F>
Create a new
Curve
whose parameter space is related to the parameter space of this curve
by f
. For each time t
, the sample from the new curve at time t
is the sample from
this curve at time f(t)
. The given domain
will be the domain of the new curve. The
function f
is expected to take domain
into self.domain()
. Read moreSource§fn reparametrize_linear(
self,
domain: Interval,
) -> Result<LinearReparamCurve<T, Self>, LinearReparamError>
fn reparametrize_linear( self, domain: Interval, ) -> Result<LinearReparamCurve<T, Self>, LinearReparamError>
Source§fn reparametrize_by_curve<C>(self, other: C) -> CurveReparamCurve<T, Self, C>
fn reparametrize_by_curve<C>(self, other: C) -> CurveReparamCurve<T, Self, C>
Source§fn graph(self) -> GraphCurve<T, Self>
fn graph(self) -> GraphCurve<T, Self>
Source§fn zip<S, C>(
self,
other: C,
) -> Result<ZipCurve<T, S, Self, C>, InvalidIntervalError>where
C: Curve<S>,
fn zip<S, C>(
self,
other: C,
) -> Result<ZipCurve<T, S, Self, C>, InvalidIntervalError>where
C: Curve<S>,
Source§fn chain<C>(self, other: C) -> Result<ChainCurve<T, Self, C>, ChainError>where
C: Curve<T>,
fn chain<C>(self, other: C) -> Result<ChainCurve<T, Self, C>, ChainError>where
C: Curve<T>,
Source§fn reverse(self) -> Result<ReverseCurve<T, Self>, ReverseError>
fn reverse(self) -> Result<ReverseCurve<T, Self>, ReverseError>
Source§fn repeat(self, count: usize) -> Result<RepeatCurve<T, Self>, RepeatError>
fn repeat(self, count: usize) -> Result<RepeatCurve<T, Self>, RepeatError>
Source§fn forever(self) -> Result<ForeverCurve<T, Self>, RepeatError>
fn forever(self) -> Result<ForeverCurve<T, Self>, RepeatError>
Source§fn ping_pong(self) -> Result<PingPongCurve<T, Self>, PingPongError>
fn ping_pong(self) -> Result<PingPongCurve<T, Self>, PingPongError>
Source§fn chain_continue<C>(
self,
other: C,
) -> Result<ContinuationCurve<T, Self, C>, ChainError>where
T: VectorSpace,
C: Curve<T>,
fn chain_continue<C>(
self,
other: C,
) -> Result<ContinuationCurve<T, Self, C>, ChainError>where
T: VectorSpace,
C: Curve<T>,
Source§fn samples(
&self,
samples: usize,
) -> Result<impl Iterator<Item = T>, ResamplingError>
fn samples( &self, samples: usize, ) -> Result<impl Iterator<Item = T>, ResamplingError>
Extract an iterator over evenly-spaced samples from this curve. Read more
Source§impl<C, T> CurveResampleExt<T> for C
impl<C, T> CurveResampleExt<T> for C
Source§fn resample<I>(
&self,
segments: usize,
interpolation: I,
) -> Result<SampleCurve<T, I>, ResamplingError>
fn resample<I>( &self, segments: usize, interpolation: I, ) -> Result<SampleCurve<T, I>, ResamplingError>
Resample this
Curve
to produce a new one that is defined by interpolation over equally
spaced sample values, using the provided interpolation
to interpolate between adjacent samples.
The curve is interpolated on segments
segments between samples. For example, if segments
is 1,
only the start and end points of the curve are used as samples; if segments
is 2, a sample at
the midpoint is taken as well, and so on. Read moreSource§fn resample_auto(
&self,
segments: usize,
) -> Result<SampleAutoCurve<T>, ResamplingError>where
T: StableInterpolate,
fn resample_auto(
&self,
segments: usize,
) -> Result<SampleAutoCurve<T>, ResamplingError>where
T: StableInterpolate,
Resample this
Curve
to produce a new one that is defined by interpolation over equally
spaced sample values, using automatic interpolation to interpolate between adjacent samples.
The curve is interpolated on segments
segments between samples. For example, if segments
is 1,
only the start and end points of the curve are used as samples; if segments
is 2, a sample at
the midpoint is taken as well, and so on. Read moreSource§fn resample_uneven<I>(
&self,
sample_times: impl IntoIterator<Item = f32>,
interpolation: I,
) -> Result<UnevenSampleCurve<T, I>, ResamplingError>
fn resample_uneven<I>( &self, sample_times: impl IntoIterator<Item = f32>, interpolation: I, ) -> Result<UnevenSampleCurve<T, I>, ResamplingError>
Source§fn resample_uneven_auto(
&self,
sample_times: impl IntoIterator<Item = f32>,
) -> Result<UnevenSampleAutoCurve<T>, ResamplingError>where
T: StableInterpolate,
fn resample_uneven_auto(
&self,
sample_times: impl IntoIterator<Item = f32>,
) -> Result<UnevenSampleAutoCurve<T>, ResamplingError>where
T: StableInterpolate,
Resample this
Curve
to produce a new one that is defined by automatic interpolation over
samples taken at the given set of times. The given sample_times
are expected to contain at least
two valid times within the curve’s domain interval. Read moreSource§impl<T, C> CurveWithDerivative<T> for Cwhere
T: HasTangent,
C: SampleDerivative<T>,
impl<T, C> CurveWithDerivative<T> for Cwhere
T: HasTangent,
C: SampleDerivative<T>,
Source§fn with_derivative(self) -> SampleDerivativeWrapper<C>
fn with_derivative(self) -> SampleDerivativeWrapper<C>
This curve, but with its first derivative included in sampling. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, C, D> SampleDerivative<T> for D
impl<T, C, D> SampleDerivative<T> for D
Source§fn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>
fn sample_with_derivative_unchecked(&self, t: f32) -> WithDerivative<T>
Sample this curve at the parameter value
t
, extracting the associated value
in addition to its derivative. This is the unchecked version of sampling, which
should only be used if the sample time t
is already known to lie within the
curve’s domain. Read moreSource§fn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>>
fn sample_with_derivative(&self, t: f32) -> Option<WithDerivative<T>>
Sample this curve’s value and derivative at the parameter value
t
, returning
None
if the point is outside of the curve’s domain.Source§fn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T>
fn sample_with_derivative_clamped(&self, t: f32) -> WithDerivative<T>
Sample this curve’s value and derivative at the parameter value
t
, clamping t
to lie inside the domain of the curve.Source§impl<T> Source for T
impl<T> Source for T
Source§type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a>
where
T: 'a
type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a
A type this
Source
can be sliced into.Source§fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>where
Chunk: Chunk<'a>,
Read a chunk of bytes into an array. Returns
None
when reading
out of bounds would occur. Read moreSource§unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
unsafe fn read_byte_unchecked(&self, offset: usize) -> u8
Read a byte without doing bounds checks. Read more
Source§fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>
Get a slice of the source at given range. This is analogous to
slice::get(range)
. Read moreSource§unsafe fn slice_unchecked(
&self,
range: Range<usize>,
) -> <T as Source>::Slice<'_>
unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>
Get a slice of the source at given range. This is analogous to
slice::get_unchecked(range)
. Read moreSource§fn is_boundary(&self, index: usize) -> bool
fn is_boundary(&self, index: usize) -> bool
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.