pub struct HeadlessBackend { /* private fields */ }Expand description
The backend. Hand it to Ui::new; keep a
HeadlessHandle to inspect it afterwards.
Implementations§
Source§impl HeadlessBackend
impl HeadlessBackend
pub fn new() -> HeadlessBackend
pub fn handle(&self) -> HeadlessHandle
Trait Implementations§
Source§impl Backend for HeadlessBackend
impl Backend for HeadlessBackend
fn metrics(&self) -> PlatformMetrics
Source§fn measure(&mut self, id: NodeId, request: MeasureRequest) -> Size
fn measure(&mut self, id: NodeId, request: MeasureRequest) -> Size
Intrinsic size of a leaf widget. Called synchronously during layout,
after all commands of the current batch have been applied.
Source§fn perform(
&mut self,
id: NodeId,
action: &A11yAction,
) -> Result<(), ActionError>
fn perform( &mut self, id: NodeId, action: &A11yAction, ) -> Result<(), ActionError>
Performs an accessibility action on the native control, as assistive
technology would. Resulting events go through the
EventSink.Source§fn synthesize(
&mut self,
id: NodeId,
input: &SyntheticInput,
) -> Result<(), ActionError>
fn synthesize( &mut self, id: NodeId, input: &SyntheticInput, ) -> Result<(), ActionError>
Synthesizes raw user input on a native control, as close to real input
as the platform allows. Used by end-to-end tests.
fn native_state(&self, id: NodeId) -> Option<NativeState>
Source§fn locale(&self) -> Rc<dyn PlatformLocale>
fn locale(&self) -> Rc<dyn PlatformLocale>
The user’s languages, and how the user’s region writes numbers
and dates. Called once, when the backend is attached.
Source§fn set_locale(&mut self, language: &LanguageIdentifier, right_to_left: bool)
fn set_locale(&mut self, language: &LanguageIdentifier, right_to_left: bool)
The app’s language, which the core chose from the user’s, and
whether it’s written right to left: set before the app’s first
window, and again when the app changes it. Make the toolkit’s own
chrome follow it where the platform lets an app choose (the
direction of title bars, menus and dialogs). Native widgets get
their direction as
Prop::LayoutDirection.Source§fn capture(&mut self, _id: NodeId, reply: Reply<Result<Image, CaptureError>>)
fn capture(&mut self, _id: NodeId, reply: Reply<Result<Image, CaptureError>>)
Offscreen screenshot of a window or node. Async because some
platforms render asynchronously (WinUI’s
RenderTargetBitmap);
reply whenever it’s ready, right away if possible.Source§fn services(&self) -> Box<dyn Services>
fn services(&self) -> Box<dyn Services>
The platform’s clipboard, dialogs and menus. Called once, when the
backend is attached; tests may replace the result.
Source§fn set_app_info(&mut self, info: &AppInfo)
fn set_app_info(&mut self, info: &AppInfo)
The app’s id, name and icon, set before the app’s first window, and
perhaps again later (tests). Apply what the platform has a place
for, to the windows there are and those to come.
Auto Trait Implementations§
impl !RefUnwindSafe for HeadlessBackend
impl !Send for HeadlessBackend
impl !Sync for HeadlessBackend
impl !UnwindSafe for HeadlessBackend
impl Forget for HeadlessBackend
impl Freeze for HeadlessBackend
impl Unpin for HeadlessBackend
impl UnsafeUnpin for HeadlessBackend
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