feat: finished zero-copy migration!
now the entire networking and persistence stack is zero-copy with single-allocation, single-copy reads. Closes #128 Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
@@ -128,12 +128,12 @@ impl Default for NetworkingConfig {
|
||||
/// .run();
|
||||
/// ```
|
||||
#[derive(Resource, Clone)]
|
||||
pub struct SessionSecret(Vec<u8>);
|
||||
pub struct SessionSecret(bytes::Bytes);
|
||||
|
||||
impl SessionSecret {
|
||||
/// Create a new session secret from bytes
|
||||
pub fn new(secret: impl Into<Vec<u8>>) -> Self {
|
||||
Self(secret.into())
|
||||
Self(bytes::Bytes::from(secret.into()))
|
||||
}
|
||||
|
||||
/// Get the secret as a byte slice
|
||||
|
||||
Reference in New Issue
Block a user