pub struct SampleGlobal<'a> { /* private fields */ }Expand description
This an example of the API that is generated for a global in .slint design markup. This may help you understand
what functions you can call and how you can pass data in and out.
This is the source code:
export global SampleGlobal {
in-out property<int> value;
// ... maybe more callbacks or public functions here
}Note: Globals are only accessible in Rust if they are exported from the root file or
the slint! macro!
Implementations§
Trait Implementations§
Source§impl<'a> Global<'a, SampleComponent> for SampleGlobal<'a>
The Global trait is implemented for each global.
This allows accessing the global from its corresponding component (in this case SampleComponent)
using the Global::get or ComponentHandle::global functions.
impl<'a> Global<'a, SampleComponent> for SampleGlobal<'a>
The Global trait is implemented for each global.
This allows accessing the global from its corresponding component (in this case SampleComponent)
using the Global::get or ComponentHandle::global functions.
Source§type StaticSelf = SampleGlobal<'static>
type StaticSelf = SampleGlobal<'static>
The
Self type, with a 'static lifetime.Source§fn get(component: &'a SampleComponent) -> Self
fn get(component: &'a SampleComponent) -> Self
Returns a reference to the global.
impl StrongHandle for SampleGlobal<'static>
The StrongHandle trait is implemented for each global.
It marks this component as holding a strong reference to the Slint element tree
and allows using this component with a Weak reference.
Auto Trait Implementations§
impl<'a> Freeze for SampleGlobal<'a>
impl<'a> RefUnwindSafe for SampleGlobal<'a>
impl<'a> Send for SampleGlobal<'a>
impl<'a> Sync for SampleGlobal<'a>
impl<'a> Unpin for SampleGlobal<'a>
impl<'a> UnsafeUnpin for SampleGlobal<'a>
impl<'a> !UnwindSafe for SampleGlobal<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.