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
|
@ -174,6 +174,14 @@ impl Message {
|
|||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
Self::Request { payload, .. }
|
||||
|
|
Loading…
Reference in a new issue