Skip to main content

MvuRuntimeBuilder

Struct MvuRuntimeBuilder 

Source
pub struct MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Event: EventTrait, Model: Clone, Logic: MvuLogic<Event, Model, Props>, Render: Renderer<Props>, Spawn: Spawner,
{ /* private fields */ }
Expand description

Builder for configuring and constructing an MvuRuntime.

Created via MvuRuntime::builder. Allows customizing runtime parameters like event buffer capacity before building the runtime.

§Example

// Use builder for custom configuration
let runtime = MvuRuntime::builder(Model, MyLogic, MyRenderer, |_| {})
    .capacity(64)
    .build();

Implementations§

Source§

impl<Event, Model, Props, Logic, Render, Spawn> MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Event: EventTrait, Model: Clone + 'static, Props: 'static, Logic: MvuLogic<Event, Model, Props>, Render: Renderer<Props>, Spawn: Spawner,

Source

pub fn capacity(self, capacity: usize) -> Self

Set the event buffer capacity.

This bounds the number of events that can be queued before Emitter::try_emit returns false.

Defaults to DEFAULT_EVENT_CAPACITY (32).

Source

pub fn build(self) -> MvuRuntime<Event, Model, Props, Logic, Render, Spawn>

Build the runtime with the configured settings.

Auto Trait Implementations§

§

impl<Event, Model, Props, Logic, Render, Spawn> Freeze for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: Freeze, Logic: Freeze, Render: Freeze, Spawn: Freeze,

§

impl<Event, Model, Props, Logic, Render, Spawn> RefUnwindSafe for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: RefUnwindSafe, Logic: RefUnwindSafe, Render: RefUnwindSafe, Spawn: RefUnwindSafe, Event: RefUnwindSafe, Props: RefUnwindSafe,

§

impl<Event, Model, Props, Logic, Render, Spawn> Send for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: Send, Logic: Send, Render: Send, Spawn: Send, Props: Send,

§

impl<Event, Model, Props, Logic, Render, Spawn> Sync for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: Sync, Logic: Sync, Render: Sync, Spawn: Sync, Props: Sync,

§

impl<Event, Model, Props, Logic, Render, Spawn> Unpin for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: Unpin, Logic: Unpin, Render: Unpin, Spawn: Unpin, Event: Unpin, Props: Unpin,

§

impl<Event, Model, Props, Logic, Render, Spawn> UnwindSafe for MvuRuntimeBuilder<Event, Model, Props, Logic, Render, Spawn>
where Model: UnwindSafe, Logic: UnwindSafe, Render: UnwindSafe, Spawn: UnwindSafe, Event: UnwindSafe, Props: UnwindSafe,

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.