pub struct PatternGrid<Msg: Clone> { /* private fields */ }Implementations§
Source§impl<Msg: Clone> PatternGrid<Msg>
impl<Msg: Clone> PatternGrid<Msg>
pub fn new(path: Vec<u8>) -> Self
Sourcepub fn size(self, s: impl Into<Length>) -> Self
pub fn size(self, s: impl Into<Length>) -> Self
Side of the square grid; without it the theme’s fluid default applies.
pub fn on_node(self, f: impl Fn(u8) -> Msg + 'static) -> Self
pub fn on_release(self, msg: Msg) -> Self
Sourcepub fn hide_stroke(self, hide: bool) -> Self
pub fn hide_stroke(self, hide: bool) -> Self
Draw only the nodes, never the stroke: against shoulder surfing.
pub fn preferred_size(&self, max_width: f32, canvas: &Canvas) -> (f32, f32)
pub fn draw(&self, canvas: &mut Canvas, rect: Rect, _focused: bool)
Trait Implementations§
Source§impl<Msg: Clone + 'static> From<PatternGrid<Msg>> for Element<Msg>
impl<Msg: Clone + 'static> From<PatternGrid<Msg>> for Element<Msg>
Source§fn from(g: PatternGrid<Msg>) -> Self
fn from(g: PatternGrid<Msg>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Msg> Freeze for PatternGrid<Msg>where
Msg: Freeze,
impl<Msg> !RefUnwindSafe for PatternGrid<Msg>
impl<Msg> !Send for PatternGrid<Msg>
impl<Msg> !Sync for PatternGrid<Msg>
impl<Msg> Unpin for PatternGrid<Msg>where
Msg: Unpin,
impl<Msg> !UnwindSafe for PatternGrid<Msg>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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