profileRyan KesPGP keyI build stuffEmailGithubTwitterLast.fmMastodonMatrix

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

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Traits for Range\<A>

impl<A> Iterator for Range<A> where
    A: Step,     type Item = A;

Related

Footnotes