Skip to content

Commit cfd59db

Browse files
author
Cameron
authored
feat: Add Status with Details Constructor (#308)
1 parent 2e082f8 commit cfd59db

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tonic/src/status.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,15 @@ impl Status {
401401

402402
Ok(())
403403
}
404+
405+
/// Create a new `Status` with the associated code, message, and binary details field.
406+
pub fn with_details(code: Code, message: impl Into<String>, details: Bytes) -> Status {
407+
Status {
408+
code,
409+
message: message.into(),
410+
details: details,
411+
}
412+
}
404413
}
405414

406415
impl fmt::Debug for Status {

0 commit comments

Comments
 (0)