pub struct Scope { /* private fields */ }Expand description
A prepared component. Publish only after all fallible preparation succeeds.
Implementations§
Source§impl Scope
impl Scope
pub fn text<T: Display>( &mut self, id: usize, read: impl Fn() -> T + 'static, ) -> Result<(), Error>
pub fn on<R: EventResult>( &mut self, id: usize, name: &'static str, callback: impl FnMut(Event) -> R + 'static, ) -> Result<(), Error>
pub fn bind_text( &mut self, id: usize, model: impl TextValue, ) -> Result<(), Error>
pub fn bind_checkbox( &mut self, id: usize, model: impl Checkbox, choice: impl Fn() -> String + 'static, ) -> Result<(), Error>
pub fn value<T: Display>( &mut self, id: usize, read: impl Fn() -> T + 'static, ) -> Result<(), Error>
pub fn checked( &mut self, id: usize, read: impl Fn() -> bool + 'static, ) -> Result<(), Error>
pub fn attribute<T: Display>( &mut self, id: usize, name: &'static str, read: impl Fn() -> T + 'static, ) -> Result<(), Error>
pub fn boolean( &mut self, id: usize, name: &'static str, read: impl Fn() -> bool + 'static, ) -> Result<(), Error>
pub fn class( &mut self, id: usize, name: &'static str, read: impl Fn() -> bool + 'static, ) -> Result<(), Error>
Source§impl Scope
impl Scope
pub fn is_coherent(&self) -> bool
pub fn set_coherent_renderer( &mut self, render: impl Fn(&mut Frame<'_>) -> Result<(), String> + 'static, )
pub fn async_region( &mut self, id: usize, boundary: AsyncBoundary, render: impl Fn(&mut Frame<'_>) -> Result<(), String> + 'static, ) -> Result<(), Error>
Source§impl Scope
impl Scope
pub fn new( parent: Option<&OwnerHandle>, specs: &[StaticNode], ) -> Result<Self, Error>
pub fn with_styles( parent: Option<&OwnerHandle>, specs: &[StaticNode], styles: StyleSheet, ) -> Result<Self, Error>
pub fn owner(&self) -> OwnerHandle
pub fn root(&self) -> Node
pub fn publish(&self)
pub fn dispose(&self)
pub fn take_errors(&self) -> Vec<Error>
pub fn take_dirty(&self) -> bool
Sourcepub fn is_faulted(&self) -> bool
pub fn is_faulted(&self) -> bool
A publication fault makes further interaction unsafe; the host must exit.
pub fn retain<T: 'static>(&mut self, value: T) -> Rc<T>
Source§impl Scope
impl Scope
pub fn branch<T: Clone + PartialEq + 'static>( &mut self, id: usize, read: impl Fn() -> (usize, T) + 'static, prepare: impl Fn(usize, Signal<T>, &OwnerHandle) -> Result<Scope, Error> + 'static, ) -> Result<(), Error>
pub fn keyed<T: Clone + PartialEq + 'static, K: Ord + Clone + 'static>( &mut self, id: usize, read: impl Fn() -> Vec<T> + 'static, key: impl Fn(&T) -> K + 'static, prepare: impl Fn(Signal<T>, &OwnerHandle) -> Result<Scope, Error> + 'static, ) -> Result<(), Error>
pub fn component<T: Component, K: Clone + PartialEq + 'static, I: Fn() -> Option<K> + 'static, M: Fn(OwnerHandle) -> Result<T, Error> + 'static>( &mut self, id: usize, identity: I, make: M, children: Children, ) -> Result<(), Error>
pub fn children(&mut self, id: usize, children: &Children) -> Result<(), Error>
Trait Implementations§
Source§impl RouteScope for Scope
impl RouteScope for Scope
type Target = Node
type Error = Error
fn error(message: &str) -> Error
Source§fn prepare_at(
&mut self,
target: &Node,
_parent_active: bool,
) -> Result<(), Error>
fn prepare_at( &mut self, target: &Node, _parent_active: bool, ) -> Result<(), Error>
Validate that the view is detached, attach it without activation, and
finish fallible renderer setup. When
parent_active is true, finish the
complete candidate subtree before returning. A failure or later drop
must undo attachment without disturbing the current view. Read moreSource§impl Scope for Scope
impl Scope for Scope
fn owner(&self) -> OwnerHandle
fn retain_state<T: 'static>(&mut self, value: T) -> Rc<T>
Source§fn prepares_effects(&self) -> bool
fn prepares_effects(&self) -> bool
Explicit candidate preparation defers constructor effects until activation.
Ordinary mounting preserves their immediate execution.
Auto Trait Implementations§
impl !RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl !UnwindSafe for Scope
impl Freeze for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more