Skip to main content

BridgeState

Struct BridgeState 

Source
pub struct BridgeState { /* private fields */ }
Expand description

Owns one cached model and lifecycle/order watermarks for one container.

§Examples

let mut bridge = adam_web_ui::graph::BridgeState::default();
bridge.start(1)?;
assert!(bridge.start(1).is_err());

Implementations§

Source§

impl BridgeState

Source

pub fn process(&mut self, message: ViewMessage) -> Result<Option<ViewReply>>

Dispatches a typed lifecycle message without framework-specific branching.

§Errors

Returns startup errors; current update failures are explicit failed replies.

  • Complexity: O(p) time and space in model construction/propagation work.
§Examples
use adam_web_ui::graph::{BridgeState, ViewMessage};
assert!(BridgeState::default().process(ViewMessage::Start { generation: 1 })?.is_none());
Source

pub fn start(&mut self, generation: u32) -> Result<()>

Claims a strictly newer generation and parses its model exactly once.

§Errors

Returns an error for a repeated/older generation or model initialization failure. A failed initialization still retires the claimed generation.

  • Complexity: O(p) time and space for model initialization work p.
§Examples
let mut bridge = adam_web_ui::graph::BridgeState::default();
bridge.start(1)?;
Source

pub fn handle(&mut self, request: ViewRequest) -> Result<Option<ViewReply>>

Evaluates current ordered work without implicitly starting a generation.

Returns None only for inactive/unknown generations, consumed sequences, or older geometry. Invalid current inputs produce a Failed reply. Failed current requests consume their ordering identity too.

§Errors

Reserves transport-level errors for the channel owner; model/input errors are represented by ViewReply::Failed.

  • Complexity: O(p) time and space in cached model propagation work p.
§Examples
let mut bridge = BridgeState::default();
assert!(bridge.handle(ViewRequest { generation: 1, revision: 1, sequence: 1,
    bounds: [0.0, 0.0, 1.0, 1.0], viewport: [100.0, 100.0],
    action: ViewAction::Fit })?.is_none());
Source

pub fn dispose(&mut self, generation: u32)

Retires only the matching generation, retaining its terminal watermark.

§Examples
let mut bridge = adam_web_ui::graph::BridgeState::default();
bridge.start(1)?;
bridge.dispose(1);
assert!(bridge.start(1).is_err());

Trait Implementations§

Source§

impl Default for BridgeState

Source§

fn default() -> BridgeState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> InitializeFromFunction<T> for T

§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

§

fn super_from(input: T) -> O

Convert from a type to another type.
§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more