pub enum CouplingResponse {
AttractToMin,
RepelFromMax,
AlignVelocity,
FlowAdvect,
DampenInside {
factor: f32,
},
ContainmentWall,
Open {
predicate: String,
},
}Expand description
How a node responds to a field at its position.
Recognized core (force). The six force responses are the recognized core:
seiche dispatches on them to integrate motion. This is the statements-over-schema
“recognized core gets behavior” half; the responses are also the v1 surface.
Open tail. The coupling contract is deliberately open beyond force (the
field-system extraction
names visual, navigational, selection, semantic, and trigger families).
CouplingResponse::Open carries any such response by an open IRI
(COUPLING_VOCAB), stored faithfully and handled generically until a
consumer recognizes it. The force integrator ignores Open, so the open tail
never breaks dispatch. Recognized-core IRIs round-trip via
recognized_iri / from_iri.
Variants§
AttractToMin
Move along -grad(scalar) (gradient descent on a potential).
RepelFromMax
Move along +grad(scalar) (gradient ascent).
AlignVelocity
Set velocity equal to the vector field at this position.
FlowAdvect
Advect: pos += dt * field(pos).
DampenInside
Multiplicative damping when inside a positive scalar region.
ContainmentWall
Hard pushout when the scalar field exceeds zero.
Open
Open tail: a non-force response identified by an open IRI (see
COUPLING_VOCAB). Stored faithfully, ignored by the force integrator,
recognized by whatever consumer owns its family (paint, camera, …).
Implementations§
Source§impl CouplingResponse
impl CouplingResponse
Sourcepub fn open(predicate: impl Into<String>) -> CouplingResponse
pub fn open(predicate: impl Into<String>) -> CouplingResponse
Build a response from an IRI, canonicalizing a recognized core IRI back to
its typed variant and wrapping anything else as Self::Open.
Sourcepub fn is_force(&self) -> bool
pub fn is_force(&self) -> bool
Whether this is a recognized force-core response (vs an open-tail one).
Sourcepub fn predicate(&self) -> Option<&str>
pub fn predicate(&self) -> Option<&str>
The open predicate IRI for an Open response; None for the
recognized force core (whose IRI is recognized_iri).
Sourcepub fn recognized_iri(&self) -> Option<&'static str>
pub fn recognized_iri(&self) -> Option<&'static str>
Canonical IRI for a recognized force-core response; None for Open.
Variant params (e.g. DampenInside.factor) are statement-level data, not
part of the IRI.
Sourcepub fn from_iri(iri: &str) -> Option<CouplingResponse>
pub fn from_iri(iri: &str) -> Option<CouplingResponse>
The recognized force-core response for a canonical IRI, if any. Inverse of
recognized_iri. DampenInside comes back with
factor = 1.0 (the no-op identity); the real factor is carried separately,
not in the IRI.
Trait Implementations§
Source§impl Clone for CouplingResponse
impl Clone for CouplingResponse
Source§fn clone(&self) -> CouplingResponse
fn clone(&self) -> CouplingResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CouplingResponse
impl Debug for CouplingResponse
Source§impl<'de> Deserialize<'de> for CouplingResponse
impl<'de> Deserialize<'de> for CouplingResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CouplingResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CouplingResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoEnumIterator for CouplingResponse
impl IntoEnumIterator for CouplingResponse
type Iterator = CouplingResponseIter
fn iter() -> CouplingResponseIter ⓘ
Source§impl PartialEq for CouplingResponse
impl PartialEq for CouplingResponse
Source§impl Serialize for CouplingResponse
impl Serialize for CouplingResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CouplingResponse
Auto Trait Implementations§
impl Freeze for CouplingResponse
impl RefUnwindSafe for CouplingResponse
impl Send for CouplingResponse
impl Sync for CouplingResponse
impl Unpin for CouplingResponse
impl UnsafeUnpin for CouplingResponse
impl UnwindSafe for CouplingResponse
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MemoryPayload for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.