pub struct AdapterLifecycle { /* private fields */ }Expand description
Deterministic adapter lifecycle model.
Implementations§
Source§impl AdapterLifecycle
impl AdapterLifecycle
Sourcepub fn new(kind: AdapterKind, adapter_id: impl Into<String>) -> Self
pub fn new(kind: AdapterKind, adapter_id: impl Into<String>) -> Self
Create a fresh adapter in AdapterPhase::Created.
Sourcepub const fn phase(&self) -> AdapterPhase
pub const fn phase(&self) -> AdapterPhase
Current phase.
Sourcepub const fn kind(&self) -> AdapterKind
pub const fn kind(&self) -> AdapterKind
Adapter flavor.
Sourcepub fn apply(
&mut self,
action: &AdapterAction,
) -> Result<AdapterEvent, AdapterMisuse>
pub fn apply( &mut self, action: &AdapterAction, ) -> Result<AdapterEvent, AdapterMisuse>
Apply a host action, returning the transition event or the misuse.
§Errors
Returns AdapterMisuse when the action is illegal in the current
phase for this adapter kind. React deduplicates StrictMode-style
repeats of idempotent steps (mount when mounted, detach when detached,
dispose when disposed); vanilla reports them as misuse.
Trait Implementations§
Source§impl Clone for AdapterLifecycle
impl Clone for AdapterLifecycle
Auto Trait Implementations§
impl Freeze for AdapterLifecycle
impl RefUnwindSafe for AdapterLifecycle
impl Send for AdapterLifecycle
impl Sync for AdapterLifecycle
impl Unpin for AdapterLifecycle
impl UnsafeUnpin for AdapterLifecycle
impl UnwindSafe for AdapterLifecycle
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