glib::collections::ptr_slice

Trait IntoPtrSlice

Source
pub trait IntoPtrSlice<T: TransparentPtrType> {
    // Required method
    fn run_with_ptr_slice<R, F: FnOnce(&[<T as GlibPtrDefault>::GlibType]) -> R>(
        self,
        f: F,
    ) -> R;
}
Expand description

A trait to accept both &[T] or PtrSlice<T> as an argument.

Required Methods§

Source

fn run_with_ptr_slice<R, F: FnOnce(&[<T as GlibPtrDefault>::GlibType]) -> R>( self, f: F, ) -> R

Runs the given closure with a NULL-terminated array.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: TransparentPtrType> IntoPtrSlice<T> for &[T]

Source§

fn run_with_ptr_slice<R, F: FnOnce(&[<T as GlibPtrDefault>::GlibType]) -> R>( self, f: F, ) -> R

Source§

impl<T: TransparentPtrType> IntoPtrSlice<T> for Vec<T>

Source§

fn run_with_ptr_slice<R, F: FnOnce(&[<T as GlibPtrDefault>::GlibType]) -> R>( self, f: F, ) -> R

Source§

impl<T: TransparentPtrType, const N: usize> IntoPtrSlice<T> for [T; N]

Source§

fn run_with_ptr_slice<R, F: FnOnce(&[<T as GlibPtrDefault>::GlibType]) -> R>( self, f: F, ) -> R

Implementors§