pub unsafe trait UIMenuBuilder: MainThreadOnly {
Show 24 methods
// Provided methods
fn system(&self) -> Retained<UIMenuSystem>
where Self: Sized + Message { ... }
fn menuForIdentifier(
&self,
identifier: &UIMenuIdentifier,
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
fn actionForIdentifier(
&self,
identifier: &UIActionIdentifier,
) -> Option<Retained<UIAction>>
where Self: Sized + Message { ... }
unsafe fn commandForAction_propertyList(
&self,
action: Sel,
property_list: Option<&AnyObject>,
) -> Option<Retained<UICommand>>
where Self: Sized + Message { ... }
fn replaceMenuForIdentifier_withMenu(
&self,
replaced_identifier: &UIMenuIdentifier,
replacement_menu: &UIMenu,
)
where Self: Sized + Message { ... }
unsafe fn replaceChildrenOfMenuForIdentifier_fromChildrenBlock(
&self,
parent_identifier: &UIMenuIdentifier,
children_block: &DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> NonNull<NSArray<UIMenuElement>> + '_>,
)
where Self: Sized + Message { ... }
fn replaceMenuForIdentifier_withElements(
&self,
replaced_identifier: &UIMenuIdentifier,
replacement_elements: &NSArray<UIMenuElement>,
)
where Self: Sized + Message { ... }
fn replaceActionForIdentifier_withElements(
&self,
replaced_identifier: &UIActionIdentifier,
replacement_elements: &NSArray<UIMenuElement>,
)
where Self: Sized + Message { ... }
unsafe fn replaceCommandForAction_propertyList_withElements(
&self,
replaced_action: Sel,
replaced_property_list: Option<&AnyObject>,
replacement_elements: &NSArray<UIMenuElement>,
)
where Self: Sized + Message { ... }
fn insertSiblingMenu_beforeMenuForIdentifier(
&self,
sibling_menu: &UIMenu,
sibling_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertElements_beforeMenuForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertElements_afterMenuForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertSiblingMenu_afterMenuForIdentifier(
&self,
sibling_menu: &UIMenu,
sibling_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertChildMenu_atStartOfMenuForIdentifier(
&self,
child_menu: &UIMenu,
parent_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertElements_beforeActionForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIActionIdentifier,
)
where Self: Sized + Message { ... }
fn insertElements_afterActionForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIActionIdentifier,
)
where Self: Sized + Message { ... }
unsafe fn insertElements_beforeCommandForAction_propertyList(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_action: Sel,
sibling_property_list: Option<&AnyObject>,
)
where Self: Sized + Message { ... }
unsafe fn insertElements_afterCommandForAction_propertyList(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_action: Sel,
sibling_property_list: Option<&AnyObject>,
)
where Self: Sized + Message { ... }
fn insertElements_atStartOfMenuForIdentifier(
&self,
child_elements: &NSArray<UIMenuElement>,
parent_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertChildMenu_atEndOfMenuForIdentifier(
&self,
child_menu: &UIMenu,
parent_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn insertElements_atEndOfMenuForIdentifier(
&self,
child_elements: &NSArray<UIMenuElement>,
parent_identifier: &UIMenuIdentifier,
)
where Self: Sized + Message { ... }
fn removeMenuForIdentifier(&self, removed_identifier: &UIMenuIdentifier)
where Self: Sized + Message { ... }
fn removeActionForIdentifier(&self, removed_identifier: &UIActionIdentifier)
where Self: Sized + Message { ... }
unsafe fn removeCommandForAction_propertyList(
&self,
removed_action: Sel,
removed_property_list: Option<&AnyObject>,
)
where Self: Sized + Message { ... }
}UIMenuBuilder only.Expand description
Encapsulates access and mutation for a menu hierarchy.
See also Apple’s documentation
Provided Methods§
Sourcefn system(&self) -> Retained<UIMenuSystem>
Available on crate feature UIMenuSystem only.
fn system(&self) -> Retained<UIMenuSystem>
UIMenuSystem only.Which system we are building for.
Available on crate features UIMenu and UIMenuElement only.
UIMenu and UIMenuElement only.Fetch the identified menu.
Parameter identifier: The identifier of the menu to fetch.
Returns: The menu with the given identifier, or nil if no such menu.
Sourcefn actionForIdentifier(
&self,
identifier: &UIActionIdentifier,
) -> Option<Retained<UIAction>>
Available on crate features UIAction and UIMenuElement only.
fn actionForIdentifier( &self, identifier: &UIActionIdentifier, ) -> Option<Retained<UIAction>>
UIAction and UIMenuElement only.Fetch the identified action.
Parameter identifier: The identifier of the action to fetch.
Returns: The action with the given identifier, or nil if no such action.
Sourceunsafe fn commandForAction_propertyList(
&self,
action: Sel,
property_list: Option<&AnyObject>,
) -> Option<Retained<UICommand>>
Available on crate features UICommand and UIMenuElement only.
unsafe fn commandForAction_propertyList( &self, action: Sel, property_list: Option<&AnyObject>, ) -> Option<Retained<UICommand>>
UICommand and UIMenuElement only.Fetch the identified command.
Parameter action: The action of the command to fetch.
Parameter propertyList: Property list object to distinguish commands, if needed.
Returns: The command with the given action and property list, or nil if no such command.
§Safety
actionmust be a valid selector.property_listshould be of the correct type.
Sourcefn replaceMenuForIdentifier_withMenu(
&self,
replaced_identifier: &UIMenuIdentifier,
replacement_menu: &UIMenu,
)
Available on crate features UIMenu and UIMenuElement only.
fn replaceMenuForIdentifier_withMenu( &self, replaced_identifier: &UIMenuIdentifier, replacement_menu: &UIMenu, )
UIMenu and UIMenuElement only.Replace an identified menu with a menu.
Parameter replacedIdentifier: The identifier of the menu to be replaced.
Parameter replacementGroup: The replacement menu.
Sourceunsafe fn replaceChildrenOfMenuForIdentifier_fromChildrenBlock(
&self,
parent_identifier: &UIMenuIdentifier,
children_block: &DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> NonNull<NSArray<UIMenuElement>> + '_>,
)
Available on crate features block2 and UIMenu and UIMenuElement only.
unsafe fn replaceChildrenOfMenuForIdentifier_fromChildrenBlock( &self, parent_identifier: &UIMenuIdentifier, children_block: &DynBlock<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> NonNull<NSArray<UIMenuElement>> + '_>, )
block2 and UIMenu and UIMenuElement only.Replace the children of an identified parent menu.
Parameter parentIdentifier: The identifier of the parent menu.
Parameter childrenBlock: A block that returns the new children, given the old children.
§Safety
children_block block’s return must be a valid pointer.
Sourcefn replaceMenuForIdentifier_withElements(
&self,
replaced_identifier: &UIMenuIdentifier,
replacement_elements: &NSArray<UIMenuElement>,
)
Available on crate features UIMenu and UIMenuElement only.
fn replaceMenuForIdentifier_withElements( &self, replaced_identifier: &UIMenuIdentifier, replacement_elements: &NSArray<UIMenuElement>, )
UIMenu and UIMenuElement only.Replace an identified menu with menu elements.
Parameter replacedIdentifier: The identifier of the menu to be replaced.
Parameter replacementElements: The replacement elements.
Sourcefn replaceActionForIdentifier_withElements(
&self,
replaced_identifier: &UIActionIdentifier,
replacement_elements: &NSArray<UIMenuElement>,
)
Available on crate features UIAction and UIMenuElement only.
fn replaceActionForIdentifier_withElements( &self, replaced_identifier: &UIActionIdentifier, replacement_elements: &NSArray<UIMenuElement>, )
UIAction and UIMenuElement only.Replace an identified action with menu elements.
Parameter replacedIdentifier: The identifier of the action to be replaced.
Parameter replacementElements: The replacement elements.
Sourceunsafe fn replaceCommandForAction_propertyList_withElements(
&self,
replaced_action: Sel,
replaced_property_list: Option<&AnyObject>,
replacement_elements: &NSArray<UIMenuElement>,
)
Available on crate feature UIMenuElement only.
unsafe fn replaceCommandForAction_propertyList_withElements( &self, replaced_action: Sel, replaced_property_list: Option<&AnyObject>, replacement_elements: &NSArray<UIMenuElement>, )
UIMenuElement only.Replace an identified command with menu elements.
Parameter replacedAction: The action of the command to be replaced.
Parameter replacedPropertyList: Property list object to distinguish commands, if needed.
Parameter replacementElements: The replacement elements.
§Safety
replaced_actionmust be a valid selector.replaced_property_listshould be of the correct type.
Sourcefn insertSiblingMenu_beforeMenuForIdentifier(
&self,
sibling_menu: &UIMenu,
sibling_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertSiblingMenu_beforeMenuForIdentifier( &self, sibling_menu: &UIMenu, sibling_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert a sibling menu before an identified sibling menu.
Parameter siblingGroup: The sibling menu to insert.
Parameter siblingIdentifier: The identifier of the sibling menu to insert before.
Sourcefn insertElements_beforeMenuForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertElements_beforeMenuForIdentifier( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert elements before an identified menu.
Parameter insertedElements: The elements to insert.
Parameter siblingIdentifier: The identifier of the menu to insert elements before.
Sourcefn insertElements_afterMenuForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertElements_afterMenuForIdentifier( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert elements after an identified menu.
Parameter insertedElements: The elements to insert.
Parameter siblingIdentifier: The identifier of the menu to insert elements after.
Sourcefn insertSiblingMenu_afterMenuForIdentifier(
&self,
sibling_menu: &UIMenu,
sibling_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertSiblingMenu_afterMenuForIdentifier( &self, sibling_menu: &UIMenu, sibling_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert a sibling menu after an identified sibling menu.
Parameter siblingGroup: The sibling menu to insert.
Parameter siblingIdentifier: The identifier of the sibling menu to insert after.
Sourcefn insertChildMenu_atStartOfMenuForIdentifier(
&self,
child_menu: &UIMenu,
parent_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertChildMenu_atStartOfMenuForIdentifier( &self, child_menu: &UIMenu, parent_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert a child menu at the start of an identified parent menu.
Parameter childGroup: The child menu to insert.
Parameter parentIdentifier: The identifier of the parent menu to insert at the start of.
Sourcefn insertElements_beforeActionForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIActionIdentifier,
)
Available on crate features UIAction and UIMenuElement only.
fn insertElements_beforeActionForIdentifier( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_identifier: &UIActionIdentifier, )
UIAction and UIMenuElement only.Insert elements before an identified action.
Parameter insertedElements: The elements to insert.
Parameter siblingIdentifier: The identifier of the action to insert elements before.
Sourcefn insertElements_afterActionForIdentifier(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_identifier: &UIActionIdentifier,
)
Available on crate features UIAction and UIMenuElement only.
fn insertElements_afterActionForIdentifier( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_identifier: &UIActionIdentifier, )
UIAction and UIMenuElement only.Insert elements after an identified action.
Parameter insertedElements: The elements to insert.
Parameter siblingIdentifier: The identifier of the action to insert elements after.
Sourceunsafe fn insertElements_beforeCommandForAction_propertyList(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_action: Sel,
sibling_property_list: Option<&AnyObject>,
)
Available on crate feature UIMenuElement only.
unsafe fn insertElements_beforeCommandForAction_propertyList( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_action: Sel, sibling_property_list: Option<&AnyObject>, )
UIMenuElement only.Insert elements before an identified command.
Parameter insertedElements: The elements to insert.
Parameter siblingAction: The action of the command to insert elements before.
Parameter siblingPropertyList: Property list object to distinguish commands, if needed.
§Safety
sibling_actionmust be a valid selector.sibling_property_listshould be of the correct type.
Sourceunsafe fn insertElements_afterCommandForAction_propertyList(
&self,
inserted_elements: &NSArray<UIMenuElement>,
sibling_action: Sel,
sibling_property_list: Option<&AnyObject>,
)
Available on crate feature UIMenuElement only.
unsafe fn insertElements_afterCommandForAction_propertyList( &self, inserted_elements: &NSArray<UIMenuElement>, sibling_action: Sel, sibling_property_list: Option<&AnyObject>, )
UIMenuElement only.Insert elements after an identified command.
Parameter insertedElements: The elements to insert.
Parameter siblingAction: The action of the command to insert elements after.
Parameter siblingPropertyList: Property list object to distinguish commands, if needed.
§Safety
sibling_actionmust be a valid selector.sibling_property_listshould be of the correct type.
Sourcefn insertElements_atStartOfMenuForIdentifier(
&self,
child_elements: &NSArray<UIMenuElement>,
parent_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertElements_atStartOfMenuForIdentifier( &self, child_elements: &NSArray<UIMenuElement>, parent_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert elements at the start of an identified parent menu.
Parameter childElements: The child elements to insert.
Parameter parentIdentifier: The identifier of the parent menu to insert elements at the start of.
Sourcefn insertChildMenu_atEndOfMenuForIdentifier(
&self,
child_menu: &UIMenu,
parent_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertChildMenu_atEndOfMenuForIdentifier( &self, child_menu: &UIMenu, parent_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert a child menu at the end of an identified parent menu.
Parameter childGroup: The child menu to insert.
Parameter parentIdentifier: The identifier of the parent menu to insert at the end of.
Sourcefn insertElements_atEndOfMenuForIdentifier(
&self,
child_elements: &NSArray<UIMenuElement>,
parent_identifier: &UIMenuIdentifier,
)
Available on crate features UIMenu and UIMenuElement only.
fn insertElements_atEndOfMenuForIdentifier( &self, child_elements: &NSArray<UIMenuElement>, parent_identifier: &UIMenuIdentifier, )
UIMenu and UIMenuElement only.Insert elements at the end of an identified parent menu.
Parameter childElements: The child elements to insert.
Parameter parentIdentifier: The identifier of the parent menu to insert elements at the end of.
Sourcefn removeMenuForIdentifier(&self, removed_identifier: &UIMenuIdentifier)
Available on crate feature UIMenu only.
fn removeMenuForIdentifier(&self, removed_identifier: &UIMenuIdentifier)
UIMenu only.Remove an identified menu.
Parameter removedIdentifier: The menu to remove.
Sourcefn removeActionForIdentifier(&self, removed_identifier: &UIActionIdentifier)
Available on crate feature UIAction only.
fn removeActionForIdentifier(&self, removed_identifier: &UIActionIdentifier)
UIAction only.Remove an identified action.
Parameter removedIdentifier: The identifier of the action to remove.
Sourceunsafe fn removeCommandForAction_propertyList(
&self,
removed_action: Sel,
removed_property_list: Option<&AnyObject>,
)
unsafe fn removeCommandForAction_propertyList( &self, removed_action: Sel, removed_property_list: Option<&AnyObject>, )
Remove an identified command.
Parameter removedAction: The action of the command to remove.
Parameter removedPropertyList: Property list object to distinguish commands, if needed.
§Safety
removed_actionmust be a valid selector.removed_property_listshould be of the correct type.
Trait Implementations§
impl<T> ImplementedBy<T> for dyn UIMenuBuilder
Source§impl ProtocolType for dyn UIMenuBuilder
impl ProtocolType for dyn UIMenuBuilder
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".