juniper

Struct Arguments

Source
pub struct Arguments<'a, S = DefaultScalarValue> { /* private fields */ }
Expand description

Field argument container

Implementations§

Source§

impl<'a, S> Arguments<'a, S>

Source

pub fn get<T>(&self, name: &str) -> FieldResult<Option<T>, S>
where T: FromInputValue<S>, T::Error: IntoFieldError<S>,

Gets an argument by the given name and converts it into the desired type.

If the argument is found, or a default argument has been provided, the given InputValue will be converted into the type T.

Returns None if an argument with such name is not present.

§Errors

If the FromInputValue conversion fails.

Source

pub fn get_input_value(&self, name: &str) -> Option<&Spanning<InputValue<S>>>

Gets a direct reference to the Spanning argument InputValue.

Trait Implementations§

Source§

impl<'a, S: Debug> Debug for Arguments<'a, 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 Arguments<'a, S>

§

impl<'a, S> RefUnwindSafe for Arguments<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for Arguments<'a, S>
where S: Send,

§

impl<'a, S> Sync for Arguments<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for Arguments<'a, S>
where S: Unpin,

§

impl<'a, S> UnwindSafe for Arguments<'a, S>
where S: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.