Added possibility to take box as ref for debug logging
This commit is contained in:
parent
3537e46be1
commit
1c951fe392
1 changed files with 8 additions and 0 deletions
|
@ -173,6 +173,14 @@ impl Message {
|
|||
| Self::Push { payload, .. } => payload.take().unwrap_or_else(|| Box::new([0u8; 0])),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_payload(&mut self) -> Option<&Box<[u8]>> {
|
||||
match self {
|
||||
Self::Request { payload, .. }
|
||||
| Self::Response { payload, .. }
|
||||
| Self::Push { payload, .. } => payload.as_ref(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_payload(&mut self, new_payload: Box<[u8]>) {
|
||||
match self {
|
||||
|
|
Loading…
Reference in a new issue