pub enum CommandPart<N: TreeNode = SyntaxNode> {
Text(CommandText<N::Token>),
Placeholder(Placeholder<N>),
}Expand description
Represents a part of a command.
Variants§
Text(CommandText<N::Token>)
A textual part of the command.
Placeholder(Placeholder<N>)
A placeholder encountered in the command.
Implementations§
Source§impl<N: TreeNode> CommandPart<N>
impl<N: TreeNode> CommandPart<N>
Sourcepub fn unwrap_text(self) -> CommandText<N::Token>
pub fn unwrap_text(self) -> CommandText<N::Token>
Sourcepub fn unwrap_placeholder(self) -> Placeholder<N>
pub fn unwrap_placeholder(self) -> Placeholder<N>
Unwraps the command part into a placeholder.
§Panics
Panics if the command part is not a placeholder.
Trait Implementations§
Source§impl<N: Clone + TreeNode> Clone for CommandPart<N>
impl<N: Clone + TreeNode> Clone for CommandPart<N>
Source§fn clone(&self) -> CommandPart<N>
fn clone(&self) -> CommandPart<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<N: Eq + TreeNode> Eq for CommandPart<N>
impl<N: TreeNode> StructuralPartialEq for CommandPart<N>
Auto Trait Implementations§
impl<N> Freeze for CommandPart<N>
impl<N> RefUnwindSafe for CommandPart<N>
impl<N> Send for CommandPart<N>
impl<N> Sync for CommandPart<N>
impl<N> Unpin for CommandPart<N>
impl<N> UnwindSafe for CommandPart<N>
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