⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

OpenWithDialog

Struct OpenWithDialog 

Source
pub struct OpenWithDialog {
    pub extension: String,
    pub mime_type: String,
    pub apps: Vec<String>,
    pub selected_index: usize,
    pub visible: bool,
}
Expand description

Model for an “Open With” dialog, presenting available apps for a file type.

Fields§

§extension: String

File extension being opened.

§mime_type: String

MIME type of the file.

§apps: Vec<String>

Available applications.

§selected_index: usize

Currently highlighted index.

§visible: bool

Whether the dialog is visible.

Implementations§

Source§

impl OpenWithDialog

Source

pub fn from_registry(registry: &AssociationRegistry, ext: &str) -> Self

Create a dialog from an association registry and file extension.

Source

pub fn select_prev(&mut self)

Move selection up.

Source

pub fn select_next(&mut self)

Move selection down.

Source

pub fn selected_app(&self) -> Option<&str>

Get the currently selected application.

Source

pub fn dismiss(&mut self)

Dismiss the dialog.

Trait Implementations§

Source§

impl Debug for OpenWithDialog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for OpenWithDialog

§

impl RefUnwindSafe for OpenWithDialog

§

impl Send for OpenWithDialog

§

impl Sync for OpenWithDialog

§

impl Unpin for OpenWithDialog

§

impl UnwindSafe for OpenWithDialog

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.