Struct patternfly_yew::Backdropper
source · pub struct Backdropper { /* private fields */ }Expand description
A context for displaying backdrops.
Implementations§
source§impl Backdropper
impl Backdropper
sourcepub fn open<B>(&self, backdrop: B)where
B: Into<Backdrop>,
pub fn open<B>(&self, backdrop: B)where
B: Into<Backdrop>,
Request a backdrop from the backdrop agent.
sourcepub fn close(&self)
pub fn close(&self)
Close the current backdrop.
Examples found in repository?
src/modal.rs (line 78)
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
fn update(&mut self, ctx: &Context<Self>, msg: Self::Message) -> bool {
match msg {
Msg::Close => {
if let Some(onclose) = &ctx.props().onclose {
onclose.emit(());
} else if let Some(backdrop) = self.backdrop.deref() {
backdrop.close();
}
}
Msg::SetBackdrop(backdrop) => {
self.backdrop.set(backdrop);
}
}
true
}More examples
src/about.rs (line 49)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
fn update(&mut self, ctx: &Context<Self>, msg: Self::Message) -> bool {
match msg {
Msg::Close => {
if let Some(onclose) = &ctx.props().onclose {
onclose.emit(());
} else {
if let Some(backdrop) = self.backdrop.deref() {
backdrop.close();
}
}
}
Msg::SetBackdrop(backdropper) => {
self.backdrop.set(backdropper);
}
}
true
}Trait Implementations§
source§impl Clone for Backdropper
impl Clone for Backdropper
source§fn clone(&self) -> Backdropper
fn clone(&self) -> Backdropper
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl PartialEq<Backdropper> for Backdropper
impl PartialEq<Backdropper> for Backdropper
source§fn eq(&self, other: &Backdropper) -> bool
fn eq(&self, other: &Backdropper) -> bool
impl StructuralPartialEq for Backdropper
Auto Trait Implementations§
impl !RefUnwindSafe for Backdropper
impl !Send for Backdropper
impl !Sync for Backdropper
impl Unpin for Backdropper
impl !UnwindSafe for Backdropper
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.