Struct mica::MethodParameterCount
source · [−]pub struct MethodParameterCount(_);
Expand description
The number of parameters in a method.
Unlike bare functions, methods can only have fixed parameter counts and can accept up to 255 arguments.
Internally, this parameter count includes the implicit self
parameter.
Implementations
sourceimpl MethodParameterCount
impl MethodParameterCount
Converting functions from various sources of parameter counts. This usually doesn’t need to be
used in application code, unless you’re dealing with the ll
API.
pub fn from_count_without_self(
count: impl TryInto<u8>
) -> Result<Self, LanguageErrorKind>
pub const fn from_count_with_self(count: u8) -> Self
pub fn from_fixed_function_parameter_count(
count: u16
) -> Result<Self, LanguageErrorKind>
pub const fn to_count_without_self(self) -> u8
sourcepub const fn to_count_with_self(self) -> u8
pub const fn to_count_with_self(self) -> u8
Converts the type-safe MethodParameterCount
into a raw u8
that includes all
parameters.
You usually want to use this when interfacing with the VM, which does not differentiate
self
from other arguments.
Trait Implementations
sourceimpl Clone for MethodParameterCount
impl Clone for MethodParameterCount
sourcefn clone(&self) -> MethodParameterCount
fn clone(&self) -> MethodParameterCount
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MethodParameterCount
impl Debug for MethodParameterCount
sourceimpl From<u8> for MethodParameterCount
impl From<u8> for MethodParameterCount
sourceimpl Hash for MethodParameterCount
impl Hash for MethodParameterCount
sourceimpl PartialEq<MethodParameterCount> for MethodParameterCount
impl PartialEq<MethodParameterCount> for MethodParameterCount
sourcefn eq(&self, other: &MethodParameterCount) -> bool
fn eq(&self, other: &MethodParameterCount) -> bool
impl Copy for MethodParameterCount
impl Eq for MethodParameterCount
impl StructuralEq for MethodParameterCount
impl StructuralPartialEq for MethodParameterCount
Auto Trait Implementations
impl RefUnwindSafe for MethodParameterCount
impl Send for MethodParameterCount
impl Sync for MethodParameterCount
impl Unpin for MethodParameterCount
impl UnwindSafe for MethodParameterCount
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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