File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1130,7 +1130,8 @@ impl Binary {
1130
1130
}
1131
1131
}
1132
1132
1133
- pub ( crate ) fn as_raw_binary ( & self ) -> RawBinaryRef < ' _ > {
1133
+ /// Borrow the contents as a `RawBinaryRef`.
1134
+ pub fn as_raw_binary ( & self ) -> RawBinaryRef < ' _ > {
1134
1135
RawBinaryRef {
1135
1136
bytes : self . bytes . as_slice ( ) ,
1136
1137
subtype : self . subtype ,
Original file line number Diff line number Diff line change @@ -460,6 +460,14 @@ pub struct RawBinaryRef<'a> {
460
460
}
461
461
462
462
impl < ' a > RawBinaryRef < ' a > {
463
+ /// Copy the contents into a `Binary`.
464
+ pub fn to_binary ( & self ) -> Binary {
465
+ Binary {
466
+ subtype : self . subtype ,
467
+ bytes : self . bytes . to_owned ( ) ,
468
+ }
469
+ }
470
+
463
471
pub ( crate ) fn len ( & self ) -> i32 {
464
472
match self . subtype {
465
473
BinarySubtype :: BinaryOld => self . bytes . len ( ) as i32 + 4 ,
You can’t perform that action at this time.
0 commit comments