[−][src]Struct safer_ffi::slice::slice_ref
&'lt [T]
but with a guaranteed #[repr(C)]
layout.
C layout (for some given type T)
typedef struct {
// Cannot be NULL
T * ptr;
size_t len;
} slice_T;
Nullable pointer?
If you want to support the above typedef, but where the ptr
field is
allowed to be NULL
(with the contents of len
then being undefined)
use the Option< slice_ptr<_> >
type.
C Layout
Implementations
impl<'lt, T: 'lt> slice_ref<'lt, T>
[src]
Trait Implementations
impl<'lt, T: 'lt> Clone for slice_ref<'lt, T>
[src]
fn clone(self: &slice_ref<'lt, T>) -> slice_ref<'lt, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'lt, T: 'lt> Copy for slice_ref<'lt, T>
[src]
impl<'_, T: Debug> Debug for slice_ref<'_, T>
[src]
impl<'_, T> Default for slice_ref<'_, T>
[src]
impl<'lt, T: 'lt> Deref for slice_ref<'lt, T>
[src]
type Target = [T]
The resulting type after dereferencing.
fn deref(self: &slice_ref<'lt, T>) -> &[T]
[src]
impl<'_, T: Eq> Eq for slice_ref<'_, T>
[src]
impl<'lt, T: 'lt> From<&'lt [T]> for slice_ref<'lt, T>
[src]
impl<'lt, T: 'lt> From<slice_mut<'lt, T>> for slice_ref<'lt, T>
[src]
impl<'lt, T: 'lt> From<slice_ref<'lt, T>> for slice_raw<T>
[src]
impl<'_, T: Hash> Hash for slice_ref<'_, T>
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_, T: Ord> Ord for slice_ref<'_, T>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_, T: PartialEq> PartialEq<slice_ref<'_, T>> for slice_ref<'_, T>
[src]
impl<'_, T: PartialOrd> PartialOrd<slice_ref<'_, T>> for slice_ref<'_, T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'lt, T> ReprC for slice_ref<'lt, T> where
NonNullRef<T>: ReprC,
<NonNullRef<T> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
usize: ReprC,
<usize as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
PhantomData<&'lt ()>: ReprC,
<PhantomData<&'lt ()> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
T: ReprC,
T: 'lt,
[src]
NonNullRef<T>: ReprC,
<NonNullRef<T> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
usize: ReprC,
<usize as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
PhantomData<&'lt ()>: ReprC,
<PhantomData<&'lt ()> as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
T: ReprC,
T: 'lt,
type CLayout = slice_ref_Layout<'lt, T>
The CType
having the same layout as Self
.
fn is_valid(it: &Self::CLayout) -> bool
[src]
impl<'lt, T: 'lt> Send for slice_ref<'lt, T> where
&'lt [T]: Send,
[src]
&'lt [T]: Send,
impl<'lt, T: 'lt> Sync for slice_ref<'lt, T> where
&'lt [T]: Sync,
[src]
&'lt [T]: Sync,
Auto Trait Implementations
impl<'lt, T> RefUnwindSafe for slice_ref<'lt, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'lt, T> Unpin for slice_ref<'lt, T>
impl<'lt, T> UnwindSafe for slice_ref<'lt, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,