deno_core
deno_core copied to clipboard
Add `fast` non-serde `ByteString` parameters
We can make ByteString
s without using serde
. While the slow path will require a scope, the fast path can make use of the *const u8
string that gets passed to the method.
At the same time, we should support #[string(onebyte)] &[u8]
which could be a zero-copy version of ByteString that would be extremely useful for HTTP headers and values.
It would also make sense to add Cow
and Vec
parameters.
The following parameter types should be supported:
-
#[string(onebyte)] Cow<[u8]>
-
#[string(onebyte)] Vec<u8>
-
#[string(onebyte)] ByteString
-
#[string(onebyte)] &[u8]
Use of #[serde] ByteString
should result in an error as users should migrate to one of the above forms.