pub struct Signature { /* private fields */ }Expand description
A function stack signature
Implementations§
Source§impl Signature
impl Signature
Sourcepub const fn new(args: usize, outputs: usize) -> Signature
pub const fn new(args: usize, outputs: usize) -> Signature
Create a new signature with the given number of arguments and outputs
Sourcepub fn with_under(self, under_args: usize, under_outputs: usize) -> Signature
pub fn with_under(self, under_args: usize, under_outputs: usize) -> Signature
Set the number of arguments and outputs of the under stack
Sourcepub const fn under_args(&self) -> usize
pub const fn under_args(&self) -> usize
Get the number of under arguments
Sourcepub const fn under_outputs(&self) -> usize
pub const fn under_outputs(&self) -> usize
Get the number of under outputs
Sourcepub const fn set_outputs(&mut self, outputs: usize)
pub const fn set_outputs(&mut self, outputs: usize)
Set the number of outputs
Sourcepub fn update_args(&mut self, f: impl FnOnce(usize) -> usize)
pub fn update_args(&mut self, f: impl FnOnce(usize) -> usize)
Update the number of arguments
Sourcepub fn update_outputs(&mut self, f: impl FnOnce(usize) -> usize)
pub fn update_outputs(&mut self, f: impl FnOnce(usize) -> usize)
Update the number of outputs
Sourcepub fn update_under_args(&mut self, f: impl FnOnce(usize) -> usize)
pub fn update_under_args(&mut self, f: impl FnOnce(usize) -> usize)
Update the number of under arguments
Sourcepub fn update_under_outputs(&mut self, f: impl FnOnce(usize) -> usize)
pub fn update_under_outputs(&mut self, f: impl FnOnce(usize) -> usize)
Update the number of under outputs
Sourcepub fn update_args_outputs(
&mut self,
f: impl FnOnce(usize, usize) -> (usize, usize),
)
pub fn update_args_outputs( &mut self, f: impl FnOnce(usize, usize) -> (usize, usize), )
Update the number of arguments and outputs
Sourcepub fn is_compatible_with(self, other: Signature) -> bool
pub fn is_compatible_with(self, other: Signature) -> bool
Check if this signature changes the stack size by the same amount as another signature
Sourcepub fn is_superset_of(self, other: Signature) -> bool
pub fn is_superset_of(self, other: Signature) -> bool
Check if this Signature::is_compatible_with another signature and has at least as many arguments
Sourcepub fn is_subset_of(self, other: Signature) -> bool
pub fn is_subset_of(self, other: Signature) -> bool
Check if this Signature::is_compatible_with another signature and has at most as many arguments
Sourcepub fn max_with(self, other: Signature) -> Signature
pub fn max_with(self, other: Signature) -> Signature
Get the signature that has the maximum of the arguments and outputs of this signature and another
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Signature, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Ord for Signature
impl Ord for Signature
Source§impl PartialOrd for Signature
impl PartialOrd for Signature
Source§impl Serialize for Signature
impl Serialize for Signature
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more