Struct gdnative_core::export::ArgBuilder
source · [−]pub struct ArgBuilder<'r, 'a, T> { /* private fields */ }
Expand description
Builder for providing additional argument information for error reporting.
Implementations
sourceimpl<'r, 'a, T> ArgBuilder<'r, 'a, T>
impl<'r, 'a, T> ArgBuilder<'r, 'a, T>
sourcepub fn with_name<S: Into<Cow<'a, str>>>(self, name: S) -> Self
pub fn with_name<S: Into<Cow<'a, str>>>(self, name: S) -> Self
Provides a name for this argument. If an old name is already set, it is silently replaced. The name can either be borrowed from the environment or owned.
sourcepub fn with_type_name<S: Into<Cow<'a, str>>>(self, ty: S) -> Self
pub fn with_type_name<S: Into<Cow<'a, str>>>(self, ty: S) -> Self
Provides a more readable type name for this argument. If an old name is
already set, it is silently replaced. If no type name is given, a value
from std::any::type_name
is used. The name can either be borrowed from
the environment or owned.
sourceimpl<'r, 'a, T: FromVariant> ArgBuilder<'r, 'a, T>
impl<'r, 'a, T: FromVariant> ArgBuilder<'r, 'a, T>
sourcepub fn get(self) -> Result<T, ArgumentError<'a>>
pub fn get(self) -> Result<T, ArgumentError<'a>>
Get the converted argument value.
Errors
If the argument is missing, or cannot be converted to the desired type.
sourcepub fn get_optional(self) -> Result<Option<T>, ArgumentError<'a>>
pub fn get_optional(self) -> Result<Option<T>, ArgumentError<'a>>
Get the argument as optional.
Errors
If the argument is present, but cannot be converted to the desired type.
Auto Trait Implementations
impl<'r, 'a, T> RefUnwindSafe for ArgBuilder<'r, 'a, T> where
T: RefUnwindSafe,
impl<'r, 'a, T> Send for ArgBuilder<'r, 'a, T> where
T: Send,
impl<'r, 'a, T> Sync for ArgBuilder<'r, 'a, T> where
T: Sync,
impl<'r, 'a, T> Unpin for ArgBuilder<'r, 'a, T> where
T: Unpin,
'a: 'r,
impl<'r, 'a, T> !UnwindSafe for ArgBuilder<'r, 'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more