MCPcopy Create free account
hub / github.com/apache/arrow-rs / checked_len_plus_offset

Function checked_len_plus_offset

arrow-data/src/data.rs:259–269  ·  view source on GitHub ↗
(
    data_type: &DataType,
    len: usize,
    offset: usize,
)

Source from the content-addressed store, hash-verified

257pub type ArrayDataRef = Arc<ArrayData>;
258
259fn checked_len_plus_offset(
260 data_type: &DataType,
261 len: usize,
262 offset: usize,
263) -> Result<usize, ArrowError> {
264 len.checked_add(offset).ok_or_else(|| {
265 ArrowError::InvalidArgumentError(format!(
266 "Length {len} with offset {offset} overflows usize for {data_type}"
267 ))
268 })
269}
270
271impl ArrayData {
272 /// Create a new ArrayData instance;

Callers 7

try_newMethod · 0.85
validateMethod · 0.85
typed_offsetsMethod · 0.85
typed_bufferMethod · 0.85
validate_child_dataMethod · 0.85
check_boundsMethod · 0.85
check_run_endsMethod · 0.85

Calls 1

checked_addMethod · 0.45

Tested by

no test coverage detected