pub struct Component<B> where
B: Behavior, {
pub behavior: B,
/* private fields */
}
Fields
behavior: B
Implementations
sourceimpl<B> Component<B> where
B: Behavior,
impl<B> Component<B> where
B: Behavior,
pub fn new(behavior: B, storage: &WidgetStorage) -> StyledWidget<Component<B>>
pub fn content(&self) -> Option<&WidgetRef<<B as Behavior>::Content>>
pub fn registered_widget(
&self,
id: &<B as Behavior>::Widgets
) -> Option<WidgetRegistration>
pub fn register_widget(
&mut self,
id: <B as Behavior>::Widgets,
registration: &WidgetRegistration
)
pub fn remove(&mut self, id: &<B as Behavior>::Widgets)
pub fn map_content<F, R>(
&self,
context: &Context<Component<B>>,
with_fn: F
) -> Option<R> where
F: FnOnce(&<B as Behavior>::Content, &Context<<B as Behavior>::Content>) -> R,
pub fn map_content_mut<F, R>(
&self,
context: &Context<Component<B>>,
with_fn: F
) -> Option<R> where
F: FnOnce(&mut <B as Behavior>::Content, &Context<<B as Behavior>::Content>) -> R,
pub fn map_widget<OW, F, R>(
&self,
id: &<B as Behavior>::Widgets,
context: &Context<Component<B>>,
with_fn: F
) -> Option<R> where
OW: Widget,
F: FnOnce(&OW, &Context<OW>) -> R,
pub fn map_widget_mut<OW, F, R>(
&self,
id: &<B as Behavior>::Widgets,
context: &Context<Component<B>>,
with_fn: F
) -> Option<R> where
OW: Widget,
F: FnOnce(&mut OW, &Context<OW>) -> R,
pub fn widget_state(
&self,
id: &<B as Behavior>::Widgets,
context: &Context<Component<B>>
) -> Option<WidgetState>
pub fn lock_widget<W>(
&self,
id: &<B as Behavior>::Widgets,
context: &Context<Component<B>>
) -> Option<LockedWidget<W>> where
W: Widget,
pub fn map_event<I, C>(&self, mapper: C) -> Callback<I, ()> where
I: 'static,
C: 'static + CallbackFn<I, <B as Behavior>::Event>,
pub fn event_mapper(&self) -> EventMapper<B>
Trait Implementations
sourceimpl<B> Debug for Component<B> where
B: Debug + Behavior,
<B as Behavior>::Content: Debug,
<B as Behavior>::Widgets: Debug,
impl<B> Debug for Component<B> where
B: Debug + Behavior,
<B as Behavior>::Content: Debug,
<B as Behavior>::Widgets: Debug,
sourceimpl<B> DefaultWidget for Component<B> where
B: Behavior + Default,
impl<B> DefaultWidget for Component<B> where
B: Behavior + Default,
sourcefn default_for(storage: &WidgetStorage) -> StyledWidget<Component<B>>
fn default_for(storage: &WidgetStorage) -> StyledWidget<Component<B>>
Returns a default widget.
fn new(
navigator: WeakWidgetRegistration,
storage: &WidgetStorage
) -> StyledWidget<Component<DefaultBarBehavior<Loc>>>
fn set_title(
&mut self,
title: &str,
context: &Context<Component<DefaultBarBehavior<Loc>>>
)
sourceimpl<B> Widget for Component<B> where
B: Behavior,
impl<B> Widget for Component<B> where
B: Behavior,
type Command = ComponentCommand<<<B as Behavior>::Content as Widget>::Command, <B as Behavior>::Event>
type Command = ComponentCommand<<<B as Behavior>::Content as Widget>::Command, <B as Behavior>::Event>
Widgets may need to communicate with transmogrifier implementations. This type is the type that can be sent to a transmogrifier. Read more
type Event = InternalEvent<B>
type Event = InternalEvent<B>
The type of the event that any Transmogrifier
for this widget to
use. Read more
sourceconst CLASS: &'static str = "gooey-component"
const CLASS: &'static str = "gooey-component"
The unique class name for this widget. Must not conflict with any other
widgets in use. Widget authors should prefix their widget names to
ensure no conflicts. For example, the gooey-widgets
crate prefixes all
of the CLASS
constants with gooey-
. Read more
sourceconst FOCUSABLE: bool = false
const FOCUSABLE: bool = false
When true, the control is able to receive focus through focus advancement, most commonly done when using the tab key. Read more
sourcefn receive_event(
&mut self,
event: <Component<B> as Widget>::Event,
context: &Context<Component<B>>
)
fn receive_event(
&mut self,
event: <Component<B> as Widget>::Event,
context: &Context<Component<B>>
)
Called when an event
from the transmogrifier was received.
sourcefn text_color(style: &Style) -> Option<&ColorPair>
fn text_color(style: &Style) -> Option<&ColorPair>
Returns the effective text color for the given style.
sourcefn background_color(style: &Style) -> Option<&ColorPair>
fn background_color(style: &Style) -> Option<&ColorPair>
Returns the effective background color for the given style.
Auto Trait Implementations
impl<B> !RefUnwindSafe for Component<B>
impl<B> Send for Component<B>
impl<B> Sync for Component<B>
impl<B> Unpin for Component<B> where
B: Unpin,
<B as Behavior>::Content: Unpin,
impl<B> !UnwindSafe for Component<B>
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
sourceimpl<T> AnyWidget for T where
T: Widget + Debug + Send + Sync + Any,
impl<T> AnyWidget for T where
T: Widget + Debug + Send + Sync + Any,
sourcefn widget_type_id(&self) -> TypeId
fn widget_type_id(&self) -> TypeId
Returns the TypeId
of the widget.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more