pub struct EventBrick { /* private fields */ }Expand description
EventBrick: Generates DOM event handlers from brick definition
Implementations§
Source§impl EventBrick
impl EventBrick
Sourcepub fn on(
self,
selector: impl Into<String>,
event_type: EventType,
handler: EventHandler,
) -> Self
pub fn on( self, selector: impl Into<String>, event_type: EventType, handler: EventHandler, ) -> Self
Add an event binding
Sourcepub fn on_with(self, binding: EventBinding) -> Self
pub fn on_with(self, binding: EventBinding) -> Self
Add an event binding with options
Sourcepub fn on_window(self, event_type: EventType, handler: EventHandler) -> Self
pub fn on_window(self, event_type: EventType, handler: EventHandler) -> Self
Add a window-level event handler
Sourcepub fn to_event_js(&self) -> String
pub fn to_event_js(&self) -> String
Generate JavaScript for all event handlers
Trait Implementations§
Source§impl Brick for EventBrick
impl Brick for EventBrick
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl Clone for EventBrick
impl Clone for EventBrick
Source§fn clone(&self) -> EventBrick
fn clone(&self) -> EventBrick
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventBrick
impl Debug for EventBrick
Source§impl Default for EventBrick
impl Default for EventBrick
Source§fn default() -> EventBrick
fn default() -> EventBrick
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventBrick
impl RefUnwindSafe for EventBrick
impl Send for EventBrick
impl Sync for EventBrick
impl Unpin for EventBrick
impl UnsafeUnpin for EventBrick
impl UnwindSafe for EventBrick
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().