pub struct PresenceFabric { /* private fields */ }Expand description
Presence Fabric manages presence states for all Resonators
Key insight: Presence is multidimensional, not binary. A Resonator can be:
- Discoverable but not responsive
- Responsive but not accepting new couplings
- Present but in silent mode
Implementations§
Source§impl PresenceFabric
impl PresenceFabric
pub fn new(config: &PresenceFabricConfig) -> Self
Sourcepub async fn initialize_presence(
&self,
resonator: &ResonatorId,
config: &PresenceConfig,
) -> Result<(), String>
pub async fn initialize_presence( &self, resonator: &ResonatorId, config: &PresenceConfig, ) -> Result<(), String>
Initialize presence for a new Resonator
Sourcepub async fn signal_presence(
&self,
resonator: ResonatorId,
state: PresenceState,
) -> Result<(), PresenceError>
pub async fn signal_presence( &self, resonator: ResonatorId, state: PresenceState, ) -> Result<(), PresenceError>
Signal presence (MUST be low-cost and non-intrusive)
ARCHITECTURAL RULE: Presence signaling must not be burdensome.
Sourcepub async fn enable_silent_presence(&self, resonator: ResonatorId)
pub async fn enable_silent_presence(&self, resonator: ResonatorId)
Enable silent presence (existence without active signaling)
This is important: a Resonator may be present without actively participating. Presence does NOT imply willingness to interact.
Sourcepub async fn disable_silent_presence(&self, resonator: ResonatorId)
pub async fn disable_silent_presence(&self, resonator: ResonatorId)
Disable silent mode
Sourcepub fn get_presence(&self, resonator: &ResonatorId) -> Option<PresenceState>
pub fn get_presence(&self, resonator: &ResonatorId) -> Option<PresenceState>
Get presence state
Sourcepub fn is_present(&self, resonator: &ResonatorId) -> bool
pub fn is_present(&self, resonator: &ResonatorId) -> bool
Check if Resonator is present
Sourcepub async fn update_presence_gradient(
&self,
resonator: &ResonatorId,
adjustment: PresenceAdjustment,
)
pub async fn update_presence_gradient( &self, resonator: &ResonatorId, adjustment: PresenceAdjustment, )
Update presence gradient (called periodically to adjust presence based on behavior)
Sourcepub async fn restore_presence(
&self,
resonator: &ResonatorId,
state: &PresenceState,
) -> Result<(), String>
pub async fn restore_presence( &self, resonator: &ResonatorId, state: &PresenceState, ) -> Result<(), String>
Restore presence from continuity record
Sourcepub fn remove_presence(&self, resonator: &ResonatorId)
pub fn remove_presence(&self, resonator: &ResonatorId)
Remove presence (for cleanup)
Sourcepub fn get_all_present(&self) -> Vec<ResonatorId>
pub fn get_all_present(&self) -> Vec<ResonatorId>
Get all present Resonators
Auto Trait Implementations§
impl Freeze for PresenceFabric
impl !RefUnwindSafe for PresenceFabric
impl Send for PresenceFabric
impl Sync for PresenceFabric
impl Unpin for PresenceFabric
impl UnwindSafe for PresenceFabric
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