pub struct WinPlatformServices { /* private fields */ }win only.Implementations§
Trait Implementations§
Source§impl Default for WinPlatformServices
impl Default for WinPlatformServices
Source§impl PlatformServices for WinPlatformServices
impl PlatformServices for WinPlatformServices
Source§fn show_folder_open_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
fn show_folder_open_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
The shell folder-picker (IFileOpenDialog + FOS_PICKFOLDERS).
Source§fn show_message_dialog(
&self,
opts: MessageDialogOptions,
) -> Option<MessageDialogChoice>
fn show_message_dialog( &self, opts: MessageDialogOptions, ) -> Option<MessageDialogChoice>
TaskDialogIndirect — see this module’s doc comment for
why TaskDialog over the legacy MessageBoxW.
Source§fn open_url_result(&self, url: &str) -> ServiceResult<()>
fn open_url_result(&self, url: &str) -> ServiceResult<()>
Fallible twin of Self::open_url: reports
ShellExecuteW’s real outcome via
[crate::desktop::open_with_default] instead of open_url’s
discarded one — before this override, open_url_result fell to
crate::backend::PlatformServices::open_url_result’s default
(open_url then always Ok(())), so a failed ShellExecuteW call
(e.g. SE_ERR_FNF — the target does not exist) was silently
reported as success.
Note what this still cannot promise: ShellExecuteW reports
whether it handed the target off, not whether anything
subsequently opened. An unregistered URI scheme, for instance,
returns success (42) because the shell accepted it and will sort
out the missing handler asynchronously — see this module’s
open_url_result_and_open_path_report_a_real_shell_execute_failure
test for the failure this can honestly detect.
Source§fn reveal_in_file_manager(&self, path: &Path) -> ServiceResult<()>
fn reveal_in_file_manager(&self, path: &Path) -> ServiceResult<()>
SHOpenFolderAndSelectItems — see
win_reveal_in_file_manager’s doc for the ILCreateFromPathW/
ILClone/ILRemoveLastID PIDL dance it takes.
Source§fn open_path(&self, path: &Path) -> ServiceResult<()>
fn open_path(&self, path: &Path) -> ServiceResult<()>
ShellExecuteW(NULL, "open", path, ...) via
[crate::desktop::open_with_default] — the exact
same call Self::open_url_result makes above, just fed a
filesystem path instead of a URL string; ShellExecuteW’s
"open" verb already accepts either.
Source§fn move_to_trash(&self, path: &Path) -> ServiceResult<()>
fn move_to_trash(&self, path: &Path) -> ServiceResult<()>
[crate::desktop::move_to_trash] — see that
function’s doc for why every backend, Win-GUI included, shares
this one trash-crate-backed implementation rather than
hand-rolling SHFileOperationW(FOF_ALLOWUNDO) here.
Source§fn beep(&self) -> ServiceResult<()>
fn beep(&self) -> ServiceResult<()>
MessageBeep(MB_OK) — the default system
notification sound (Windows’ Settings maps MB_OK’s alias, “Asterisk”/
“Default Beep” depending on the Windows version, to whichever sound
scheme the user picked; there is no dedicated “just beep” API
distinct from this legacy MessageBoxW-family sound-alias
mechanism).
Source§fn system_theme(&self) -> ServiceResult<SystemTheme>
fn system_theme(&self) -> ServiceResult<SystemTheme>
UISettings::GetColorValue (Background/Accent) +
AccessibilitySettings::HighContrast — see this
module’s WinRT import comment for why the latter comes from the
same namespace rather than a separate Win32 SPI call.
Source§fn displays(&self) -> ServiceResult<Vec<Display>>
fn displays(&self) -> ServiceResult<Vec<Display>>
EnumDisplayMonitors + GetMonitorInfoW for bounds/work_area/
primary (rcMonitor/rcWork/MONITORINFOF_PRIMARY),
GetDpiForMonitor for scale.
Source§fn cursor_screen_point(&self) -> ServiceResult<Point>
fn cursor_screen_point(&self) -> ServiceResult<Point>
GetCursorPos — the global cursor position in
virtual-screen coordinates, the same coordinate space
Self::displays’s bounds/work_area use.
Source§fn platform_name(&self) -> &'static str
fn platform_name(&self) -> &'static str
BackendNative.backend field.
One of "tui", "gtk", "win-gui", "macos".fn clipboard(&self) -> &dyn Clipboard
Source§fn show_file_open_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
fn show_file_open_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
None if the
user cancelled. TUI backends have no native dialog to show and
unconditionally return None (no stderr hint is written); apps
should provide an in-TUI picker instead.Source§fn show_file_save_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
fn show_file_save_dialog(&self, opts: FileDialogOptions) -> Option<PathBuf>
Source§fn send_notification(&self, n: Notification)
fn send_notification(&self, n: Notification)
Source§fn secret_store(&self) -> &dyn SecretStore
fn secret_store(&self) -> &dyn SecretStore
Auto Trait Implementations§
impl Freeze for WinPlatformServices
impl RefUnwindSafe for WinPlatformServices
impl Send for WinPlatformServices
impl Sync for WinPlatformServices
impl Unpin for WinPlatformServices
impl UnsafeUnpin for WinPlatformServices
impl UnwindSafe for WinPlatformServices
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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> ⓘ
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> ⓘ
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