multiversx_sc/io/
arg_id.rs1#[derive(Clone, Copy)]
7pub struct ArgId(&'static [u8]);
8
9impl From<&'static [u8]> for ArgId {
10 #[inline]
11 fn from(static_bytes: &'static [u8]) -> Self {
12 ArgId(static_bytes)
13 }
14}
15
16impl From<&'static str> for ArgId {
17 #[inline]
18 fn from(static_str: &'static str) -> Self {
19 ArgId(static_str.as_bytes())
20 }
21}
22
23impl ArgId {
24 pub fn as_bytes(&self) -> &'static [u8] {
25 self.0
26 }
27
28 #[inline]
29 pub fn empty() -> Self {
30 ArgId::from(&[][..])
31 }
32}