2024-05-06 20:40:05 +00:00
|
|
|
---
|
2024-10-30 17:34:11 +00:00
|
|
|
date: 2020-11-20
|
2024-05-06 20:40:05 +00:00
|
|
|
id: 6291dde0-b0b4-4128-89c3-1fa77d39527e
|
|
|
|
title: as~mutptrrange~
|
|
|
|
---
|
|
|
|
|
|
|
|
# Description
|
|
|
|
|
|
|
|
Returns the two unsafe mutable pointers spanning the slice.
|
|
|
|
|
|
|
|
The returned range is half-open, which means that the end pointer points
|
|
|
|
one *past* the last element of the slice. This way, an empty slice is
|
|
|
|
represented by two equal pointers, and the difference between the two
|
|
|
|
pointers represents the size of the slice.
|
|
|
|
|
|
|
|
This function is useful for interacting with foreign interfaces which
|
|
|
|
use two pointers to refer to a range of elements in memory, as is common
|
|
|
|
in C++.
|
|
|
|
|
|
|
|
# Declaration
|
|
|
|
|
|
|
|
``` rust
|
|
|
|
pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>
|
|
|
|
```
|
|
|
|
|
|
|
|
# Traits for Range\<A\>
|
|
|
|
|
|
|
|
``` rust
|
|
|
|
impl<A> Iterator for Range<A> where
|
|
|
|
A: Step, type Item = A;
|
|
|
|
```
|
|
|
|
|
|
|
|
# Footnotes
|