pub struct ComponentRegistration<'a, C> {
pub app: &'a mut App,
/* private fields */
}Available on crate feature
replication only.Fields§
§app: &'a mut AppImplementations§
Source§impl<C> ComponentRegistration<'_, C>
impl<C> ComponentRegistration<'_, C>
pub fn new(app: &mut App) -> ComponentRegistration<'_, C>
Sourcepub fn add_map_entities(self) -> ComponentRegistration<'_, C>where
C: Clone + MapEntities + 'static,
pub fn add_map_entities(self) -> ComponentRegistration<'_, C>where
C: Clone + MapEntities + 'static,
Specify that the component contains entities which should be mapped from the remote world to the local world
upon deserialization using the component’s MapEntities implementation.
Sourcepub fn add_component_map_entities(self) -> ComponentRegistration<'_, C>
pub fn add_component_map_entities(self) -> ComponentRegistration<'_, C>
Similar to add_map_entities, but uses the Component::map_entities function instead of MapEntities::map_entities
pub fn with_replication_config( self, config: ComponentReplicationConfig, ) -> ComponentRegistration<'_, C>
Sourcepub fn add_delta_compression<Delta>(self) -> ComponentRegistration<'_, C>
pub fn add_delta_compression<Delta>(self) -> ComponentRegistration<'_, C>
Enable delta compression when serializing this component
Source§impl<C> ComponentRegistration<'_, C>where
C: Debug,
impl<C> ComponentRegistration<'_, C>where
C: Debug,
Sourcepub fn add_default_hash(self) -> ComponentRegistration<'_, C>
pub fn add_default_hash(self) -> ComponentRegistration<'_, C>
Add a hash function for this component using the core::hash::Hash trait implementation.
This will be used to compute a checksum for determinism checks.
Sourcepub fn add_custom_hash(
self,
f: fn(&C, &mut SeaHasher),
) -> ComponentRegistration<'_, C>where
C: Component,
pub fn add_custom_hash(
self,
f: fn(&C, &mut SeaHasher),
) -> ComponentRegistration<'_, C>where
C: Component,
Add a hash function for this component using the core::hash::Hash trait implementation.
This will be used to compute a checksum for determinism checks.
Trait Implementations§
Source§impl<C> InterpolationRegistrationExt<C> for ComponentRegistration<'_, C>
impl<C> InterpolationRegistrationExt<C> for ComponentRegistration<'_, C>
Source§fn register_interpolation_fn(
self,
interpolation_fn: fn(C, C, f32) -> C,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
fn register_interpolation_fn(
self,
interpolation_fn: fn(C, C, f32) -> C,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
Source§fn register_linear_interpolation(self) -> ComponentRegistration<'_, C>where
C: SyncComponent + Ease,
fn register_linear_interpolation(self) -> ComponentRegistration<'_, C>where
C: SyncComponent + Ease,
Source§fn add_interpolation_with(
self,
interpolation_fn: fn(C, C, f32) -> C,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
fn add_interpolation_with(
self,
interpolation_fn: fn(C, C, f32) -> C,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
Source§fn add_linear_interpolation(self) -> ComponentRegistration<'_, C>where
C: SyncComponent + Ease,
fn add_linear_interpolation(self) -> ComponentRegistration<'_, C>where
C: SyncComponent + Ease,
Source§fn add_custom_interpolation(self) -> ComponentRegistration<'_, C>
fn add_custom_interpolation(self) -> ComponentRegistration<'_, C>
The remote updates will be stored in a
ConfirmedHistory<C> component
but the user has to define the interpolation logic themselves
(lightyear won’t perform any kind of interpolation)Source§impl<C> PredictionRegistrationExt<C> for ComponentRegistration<'_, C>
impl<C> PredictionRegistrationExt<C> for ComponentRegistration<'_, C>
Source§fn add_prediction(self) -> ComponentRegistration<'_, C>where
C: SyncComponent,
fn add_prediction(self) -> ComponentRegistration<'_, C>where
C: SyncComponent,
Enable prediction for this component.
Source§fn enable_correction(self) -> ComponentRegistration<'_, C>where
C: SyncComponent,
fn enable_correction(self) -> ComponentRegistration<'_, C>where
C: SyncComponent,
Enables correction for this component, without adding the correction systems. Read more
Source§fn add_linear_correction_fn<D>(self) -> ComponentRegistration<'_, C>
fn add_linear_correction_fn<D>(self) -> ComponentRegistration<'_, C>
Add correction for this component where the interpolation will done using the lerp function
provided by the
Ease trait.Source§fn add_correction_fn<D>(
self,
correction_fn: fn(D, D, f32) -> D,
) -> ComponentRegistration<'_, C>
fn add_correction_fn<D>( self, correction_fn: fn(D, D, f32) -> D, ) -> ComponentRegistration<'_, C>
Source§fn add_should_rollback(
self,
should_rollback: fn(&C, &C) -> bool,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
fn add_should_rollback(
self,
should_rollback: fn(&C, &C) -> bool,
) -> ComponentRegistration<'_, C>where
C: SyncComponent,
Add a custom comparison function to determine if we should rollback by comparing the
confirmed component with the predicted component’s history.
Auto Trait Implementations§
impl<'a, C> Freeze for ComponentRegistration<'a, C>
impl<'a, C> !RefUnwindSafe for ComponentRegistration<'a, C>
impl<'a, C> !Send for ComponentRegistration<'a, C>
impl<'a, C> !Sync for ComponentRegistration<'a, C>
impl<'a, C> Unpin for ComponentRegistration<'a, C>where
C: Unpin,
impl<'a, C> !UnwindSafe for ComponentRegistration<'a, C>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.