mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
33 lines
773 B
Markdown
33 lines
773 B
Markdown
---
|
|
date: 20201120
|
|
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
|