Skip to content
6 changes: 6 additions & 0 deletions arrow-buffer/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ impl std::ops::Deref for Buffer {
}
}

impl AsRef<[u8]> for &Buffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl From<MutableBuffer> for Buffer {
#[inline]
fn from(buffer: MutableBuffer) -> Self {
Expand Down
1 change: 1 addition & 0 deletions arrow-buffer/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod mutable;
pub use mutable::*;
mod ops;
pub use ops::*;
mod mutable_ops;
mod scalar;
pub use scalar::*;
mod boolean;
Expand Down
6 changes: 6 additions & 0 deletions arrow-buffer/src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,12 @@ impl std::ops::DerefMut for MutableBuffer {
}
}

impl AsRef<[u8]> for &MutableBuffer {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}

impl Drop for MutableBuffer {
fn drop(&mut self) {
if self.layout.size() != 0 {
Expand Down
Loading
Loading