Struct playdate_menu::MenuItem

source ·
pub struct MenuItem<Kind, UserData = (), Api = Default, const REMOVE_ON_DROP: bool = true>(/* private fields */)
where
    Kind: Kind,
    UserData: Into<Box<UserData>>,
    Api: Api;

Implementations§

source§

impl<UD, K: Kind, Api: Api, const REM: bool> MenuItem<K, UD, Api, REM>

source

pub fn get_title(&self) -> Cow<'_, str>

source

pub fn set_title<S: AsRef<str>>(&self, title: S) -> Result<(), NulError>

source

pub fn get_userdata(&self) -> Option<&mut UD>

source

pub fn set_userdata(&self, userdata: UD) -> Option<UD>

source

pub fn get_value(&self) -> c_int

source

pub fn set_value(&self, value: c_int)

source§

impl<UD: Sized, Api: Api, const REM: bool> MenuItem<Check, UD, Api, REM>

source

pub fn new<S: AsRef<str>>( title: S, checked: bool, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>where Api: Default,

source

pub fn new_with<S: AsRef<str>>( api: Api, title: S, checked: bool, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>

source§

impl<UD: Sized, Api: Api, const REM: bool> MenuItem<Simple, UD, Api, REM>

source

pub fn new<S: AsRef<str>>( title: S, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>where Api: Default,

source

pub fn new_with<S: AsRef<str>>( api: Api, title: S, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>

source§

impl<UD: Sized, Api: Api, const REM: bool> MenuItem<Options, UD, Api, REM>

source

pub fn new<S: AsRef<str>, O: AsRef<[S]>>( title: S, options: O, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>where Api: Default,

source

pub fn new_with<S: AsRef<str>, O: AsRef<[S]>>( api: Api, title: S, options: O, callback: Option<fn(userdata: &mut UD)>, userdata: UD ) -> Result<Self, ApiError>

source§

impl<UD, Api: Api, const REM: bool> MenuItem<Check, UD, Api, REM>

source

pub fn is_checked(&self) -> bool

source§

impl<UD, Api: Api, const REM: bool> MenuItem<Options, UD, Api, REM>

source

pub fn selected_option(&self) -> i32

The array index of the currently selected option.

source§

impl<UD, K: Kind, Api: Api, const REM: bool> MenuItem<K, UD, Api, REM>

source

pub fn remove(self) -> Option<UD>

Trait Implementations§

source§

impl<Kind, UserData, Api, const REMOVE_ON_DROP: bool> Debug for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>where Kind: Kind + Debug, UserData: Into<Box<UserData>> + Debug, Api: Api + Debug,

source§

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

Formats the value using the given formatter. Read more
source§

impl<UD, K: Kind, Api: Api, const REM: bool> Drop for MenuItem<K, UD, Api, REM>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<Kind, UserData, Api, const REMOVE_ON_DROP: bool> RefUnwindSafe for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>where Api: RefUnwindSafe, Kind: RefUnwindSafe, UserData: RefUnwindSafe,

§

impl<Kind, UserData = (), Api = Default, const REMOVE_ON_DROP: bool = true> !Send for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>

§

impl<Kind, UserData = (), Api = Default, const REMOVE_ON_DROP: bool = true> !Sync for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>

§

impl<Kind, UserData, Api, const REMOVE_ON_DROP: bool> Unpin for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>where Api: Unpin, Kind: Unpin, UserData: Unpin,

§

impl<Kind, UserData, Api, const REMOVE_ON_DROP: bool> UnwindSafe for MenuItem<Kind, UserData, Api, REMOVE_ON_DROP>where Api: UnwindSafe, Kind: UnwindSafe, UserData: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.