mirror of
https://github.com/actix/actix-web.git
synced 2025-01-19 13:45:25 +00:00
more body conversion impls
This commit is contained in:
parent
4ee2a60d88
commit
1aac83ac96
2 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-web"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix web framework"
|
||||
readme = "README.md"
|
||||
|
|
12
src/body.rs
12
src/body.rs
|
@ -113,12 +113,24 @@ impl From<Rc<Bytes>> for BinaryBody {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Rc<Bytes>> for BinaryBody {
|
||||
fn from(body: &'a Rc<Bytes>) -> BinaryBody {
|
||||
BinaryBody::SharedBytes(Rc::clone(body))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<Bytes>> for BinaryBody {
|
||||
fn from(body: Arc<Bytes>) -> BinaryBody {
|
||||
BinaryBody::ArcSharedBytes(body)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Arc<Bytes>> for BinaryBody {
|
||||
fn from(body: &'a Arc<Bytes>) -> BinaryBody {
|
||||
BinaryBody::ArcSharedBytes(Arc::clone(body))
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for BinaryBody {
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
match self {
|
||||
|
|
Loading…
Reference in a new issue