Initializes a [Buffer] from a slice of items.
(items: T)
| 133 | |
| 134 | /// Initializes a [Buffer] from a slice of items. |
| 135 | pub fn from_slice_ref<U: ArrowNativeType, T: AsRef<[U]>>(items: T) -> Self { |
| 136 | let slice = items.as_ref(); |
| 137 | let capacity = std::mem::size_of_val(slice); |
| 138 | let mut buffer = MutableBuffer::with_capacity(capacity); |
| 139 | buffer.extend_from_slice(slice); |
| 140 | buffer.into() |
| 141 | } |
| 142 | |
| 143 | /// Creates a buffer from an existing memory region. |
| 144 | /// |
nothing calls this directly
no test coverage detected