pub struct NodeActionDescriptor {
pub key: String,
pub label: String,
pub target: ActionTarget,
pub intent: ActionIntent,
pub availability: ActionAvailability,
pub group: Option<String>,
pub order: Option<i32>,
pub danger: bool,
pub icon_key: Option<String>,
pub shortcut: Option<ActionShortcut>,
}Expand description
Renderer-neutral command/action descriptor.
Fields§
§key: String§label: String§target: ActionTarget§intent: ActionIntent§availability: ActionAvailability§group: Option<String>§order: Option<i32>§danger: bool§icon_key: Option<String>§shortcut: Option<ActionShortcut>Implementations§
Source§impl NodeActionDescriptor
impl NodeActionDescriptor
pub fn new( key: impl Into<String>, label: impl Into<String>, target: ActionTarget, intent: ActionIntent, ) -> Self
pub fn disabled(self, reason: impl Into<String>) -> Self
pub fn with_group(self, group: impl Into<String>) -> Self
pub fn with_order(self, order: i32) -> Self
pub fn danger(self) -> Self
pub fn with_icon_key(self, icon_key: impl Into<String>) -> Self
pub fn with_shortcut(self, shortcut: ActionShortcut) -> Self
pub fn is_enabled(&self) -> bool
Trait Implementations§
Source§impl Clone for NodeActionDescriptor
impl Clone for NodeActionDescriptor
Source§fn clone(&self) -> NodeActionDescriptor
fn clone(&self) -> NodeActionDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeActionDescriptor
impl Debug for NodeActionDescriptor
Source§impl<'de> Deserialize<'de> for NodeActionDescriptor
impl<'de> Deserialize<'de> for NodeActionDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeActionDescriptor
Source§impl PartialEq for NodeActionDescriptor
impl PartialEq for NodeActionDescriptor
Source§fn eq(&self, other: &NodeActionDescriptor) -> bool
fn eq(&self, other: &NodeActionDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NodeActionDescriptor
impl Serialize for NodeActionDescriptor
impl StructuralPartialEq for NodeActionDescriptor
Auto Trait Implementations§
impl Freeze for NodeActionDescriptor
impl RefUnwindSafe for NodeActionDescriptor
impl Send for NodeActionDescriptor
impl Sync for NodeActionDescriptor
impl Unpin for NodeActionDescriptor
impl UnsafeUnpin for NodeActionDescriptor
impl UnwindSafe for NodeActionDescriptor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.