azalea_brigadier::context

Struct CommandContextBuilder

Source
pub struct CommandContextBuilder<'a, S> {
    pub arguments: HashMap<String, ParsedArgument>,
    pub root: Arc<RwLock<CommandNode<S>>>,
    pub nodes: Vec<ParsedCommandNode<S>>,
    pub dispatcher: &'a CommandDispatcher<S>,
    pub source: Arc<S>,
    pub command: Command<S>,
    pub child: Option<Rc<CommandContextBuilder<'a, S>>>,
    pub range: StringRange,
    pub modifier: Option<Arc<RedirectModifier<S>>>,
    pub forks: bool,
}

Fields§

§arguments: HashMap<String, ParsedArgument>§root: Arc<RwLock<CommandNode<S>>>§nodes: Vec<ParsedCommandNode<S>>§dispatcher: &'a CommandDispatcher<S>§source: Arc<S>§command: Command<S>§child: Option<Rc<CommandContextBuilder<'a, S>>>§range: StringRange§modifier: Option<Arc<RedirectModifier<S>>>§forks: bool

Implementations§

Source§

impl<'a, S> CommandContextBuilder<'a, S>

Source

pub fn new( dispatcher: &'a CommandDispatcher<S>, source: Arc<S>, root_node: Arc<RwLock<CommandNode<S>>>, start: usize, ) -> Self

Source

pub fn with_command(&mut self, command: &Command<S>) -> &Self

Source

pub fn with_child(&mut self, child: Rc<CommandContextBuilder<'a, S>>) -> &Self

Source

pub fn with_argument(&mut self, name: &str, argument: ParsedArgument) -> &Self

Source

pub fn with_node( &mut self, node: Arc<RwLock<CommandNode<S>>>, range: StringRange, ) -> &Self

Source

pub fn build(&self, input: &str) -> CommandContext<S>

Source

pub fn find_suggestion_context(&self, cursor: usize) -> SuggestionContext<S>

Trait Implementations§

Source§

impl<S> Clone for CommandContextBuilder<'_, S>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> Debug for CommandContextBuilder<'_, S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S> Freeze for CommandContextBuilder<'a, S>

§

impl<'a, S> !RefUnwindSafe for CommandContextBuilder<'a, S>

§

impl<'a, S> !Send for CommandContextBuilder<'a, S>

§

impl<'a, S> !Sync for CommandContextBuilder<'a, S>

§

impl<'a, S> Unpin for CommandContextBuilder<'a, S>

§

impl<'a, S> !UnwindSafe for CommandContextBuilder<'a, S>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more