#[non_exhaustive]pub struct Params<T, const N: usize> { /* private fields */ }Expand description
Helper to register a parameterized function.
This is used to wrap the name of the function in order to associated parameters with it.
§Examples
use rune::{Params, TypeHash};
use rune::hash::IntoHash;
use rune::runtime::Vec;
let params = Params::new("collect", []);
assert_eq!(params.into_hash(), "collect".into_hash());
let params = Params::new("collect", [Vec::HASH]);
assert_eq!(params.into_hash(), "collect".into_hash());Implementations§
Source§impl<T, const N: usize> Params<T, N>
impl<T, const N: usize> Params<T, N>
Sourcepub const fn new(name: T, parameters: [Hash; N]) -> Self
pub const fn new(name: T, parameters: [Hash; N]) -> Self
Construct a new parameters wrapper.
§Examples
use rune::{Params, TypeHash};
use rune::hash::IntoHash;
use rune::runtime::Vec;
let params = Params::new("collect", []);
assert_eq!(params.into_hash(), "collect".into_hash());
let params = Params::new("collect", [Vec::HASH]);
assert_eq!(params.into_hash(), "collect".into_hash());Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Params<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Params<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Params<T, N>where
T: Send,
impl<T, const N: usize> Sync for Params<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Params<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Params<T, N>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more