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§
source§impl 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§
source§impl Clone for MethodParameterCount
impl Clone for MethodParameterCount
source§fn clone(&self) -> MethodParameterCount
fn clone(&self) -> MethodParameterCount
Returns a copy 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 moresource§impl Debug for MethodParameterCount
impl Debug for MethodParameterCount
source§impl From<u8> for MethodParameterCount
impl From<u8> for MethodParameterCount
source§impl Hash for MethodParameterCount
impl Hash for MethodParameterCount
source§impl PartialEq<MethodParameterCount> for MethodParameterCount
impl PartialEq<MethodParameterCount> for MethodParameterCount
source§fn eq(&self, other: &MethodParameterCount) -> bool
fn eq(&self, other: &MethodParameterCount) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.