Struct Image

Source
pub struct Image<T: Type, C: Color> {
    pub meta: Meta<T, C>,
    pub data: Box<dyn ImageData<T>>,
}
Expand description

Image type

Fields§

§meta: Meta<T, C>

Metadata

§data: Box<dyn ImageData<T>>

Pixel data

Implementations§

Source§

impl<T: Type, C: Color> Image<T, C>

Source

pub fn hash(&self) -> Hash

Get image hash

Source§

impl<T: Type, C: Color> Image<T, C>

Source

pub fn new_with_data( size: impl Into<Size>, data: impl 'static + ImageData<T>, ) -> Result<Image<T, C>, Error>

Create a new image with the given size and data, returns Err if the provided ImageData isn’t big enough for the specified dimensions

Source

pub fn new(size: impl Into<Size>) -> Image<T, C>

Create a new image

Source

pub fn new_like(&self) -> Image<T, C>

Create a new image with the same size, type and color

Source

pub fn new_like_with_type<U: Type>(&self) -> Image<U, C>

Create a new image with the same size and color as an existing image with the given type

Source

pub fn new_like_with_color<D: Color>(&self) -> Image<T, D>

Create a new image with the same size and type as an existing image with the given color

Source

pub fn new_like_with_type_and_color<U: Type, D: Color>(&self) -> Image<U, D>

Create a new image with the same size as an existing image with the given type and color

Source

pub fn new_mmap( filename: impl AsRef<Path>, meta: Option<Meta<T, C>>, ) -> Result<Image<T, C>, Error>

New memory mapped image - if meta is None then it is assumed the image already exists on disk otherwise it will be created

Source

pub fn mmap(self, filename: impl AsRef<Path>) -> Result<Image<T, C>, Error>

Map an existing image to disk, this consumes the original and returns the memory mapped image

Source

pub fn channels(&self) -> Channel

Returns the number of channels

Source

pub fn meta(&self) -> Meta<T, C>

Get image meta

Source

pub fn width(&self) -> usize

Image width

Source

pub fn height(&self) -> usize

Image height

Source

pub fn shape(&self) -> (usize, usize, Channel)

Returns (width, height, channels)

Source

pub fn size(&self) -> Size

Get image size

Source

pub fn with_color<D: Color>(self) -> Image<T, D>

Update the colorspace associated with an image without performing any conversion

Source

pub fn buffer(&self) -> &[u8]

Get image data as bytes

Source

pub fn buffer_mut(&mut self) -> &mut [u8]

Get image data as mutable bytes

Source

pub fn get(&self, pt: impl Into<Point>) -> Data<'_, T, C>

Get data at specified index

Source

pub fn get_mut(&mut self, pt: impl Into<Point>) -> DataMut<'_, T, C>

Get mutable data at specified index

Source

pub fn set(&mut self, pt: impl Into<Point>, data: impl AsRef<[T]>)

Set data to specified location

Source

pub fn in_bounds(&self, pt: impl Into<Point>) -> bool

Returns true when (x, y) is in bounds for the given image

Source

pub fn at(&self, pt: impl Into<Point>, px: impl AsMut<[T]>) -> bool

Get image data from an image, reusing an existing data buffer big enough for a single pixel

Source

pub fn pixel_at(&self, pt: impl Into<Point>, px: &mut Pixel<C>) -> bool

Load data from and Image into an existing Pixel structure

Source

pub fn new_pixel(&self) -> Pixel<C>

Get an empty pixel for the image color type

Source

pub fn get_pixel(&self, pt: impl Into<Point>) -> Pixel<C>

Get a normalized pixel from an image

Source

pub fn set_pixel(&mut self, pt: impl Into<Point>, px: &Pixel<C>)

Set a normalized pixel to the specified location

Source

pub fn get_f(&self, pt: impl Into<Point>, c: Channel) -> f64

Get a normalized float value

Source

pub fn set_f(&mut self, pt: impl Into<Point>, c: Channel, f: f64)

Set normalized float value

Source

pub fn row(&self, y: usize) -> Data<'_, T, C>

Get row

Source

pub fn row_mut(&mut self, y: usize) -> DataMut<'_, T, C>

Get mutable row

Source

pub fn rows(&self) -> impl ParallelIterator<Item = (usize, &[T])>

Iterate over image rows

Source

pub fn rows_mut(&mut self) -> impl ParallelIterator<Item = (usize, &mut [T])>

Iterate over mutable image rows

Source

pub fn row_range( &self, y: usize, height: usize, ) -> impl ParallelIterator<Item = (usize, &[T])>

Iterate over image rows

Source

pub fn row_range_mut( &mut self, y: usize, height: usize, ) -> impl ParallelIterator<Item = (usize, &mut [T])>

Iterate over mutable image rows

Source

pub fn open(path: impl AsRef<Path>) -> Result<Image<T, C>, Error>

Read an image from disk

Source

pub fn save(&self, path: impl AsRef<Path>) -> Result<(), Error>

Write an image to disk

Source

pub fn iter_region_mut( &mut self, roi: Region, ) -> impl ParallelIterator<Item = (Point, DataMut<'_, T, C>)>

Iterate over part of an image with mutable data access

Source

pub fn iter_region( &self, roi: Region, ) -> impl ParallelIterator<Item = (Point, Data<'_, T, C>)>

Iterate over part of an image

Source

pub fn iter(&self) -> impl ParallelIterator<Item = (Point, Data<'_, T, C>)>

Get pixel iterator

Source

pub fn iter_mut( &mut self, ) -> impl ParallelIterator<Item = (Point, DataMut<'_, T, C>)>

Get mutable pixel iterator

Source

pub fn for_each<F: Sync + Send + Fn(Point, DataMut<'_, T, C>)>(&mut self, f: F)

Iterate over each pixel applying f to every pixel

Source

pub fn for_each_region<F: Sync + Send + Fn(Point, DataMut<'_, T, C>)>( &mut self, roi: Region, f: F, )

Iterate over a region of pixels qpplying f to every pixel

Source

pub fn for_each2<F: Sync + Send + Fn(Point, DataMut<'_, T, C>, Data<'_, T, C>)>( &mut self, other: &Image<T, C>, f: F, )

Iterate over each pixel of two images at once

Source

pub fn each_pixel<F: Sync + Send + FnMut(Point, &Pixel<C>)>(&self, f: F)

Iterate over pixels, with a mutable closure

Source

pub fn each_pixel_region<F: Sync + Send + FnMut(Point, &Pixel<C>)>( &self, region: Region, f: F, )

Iterate over pixels in region, with a mutable closure

Source

pub fn each_pixel_mut<F: Sync + Send + FnMut(Point, &mut Pixel<C>)>( &mut self, f: F, )

Iterate over mutable pixels, with a mutable closure

Source

pub fn each_pixel_region_mut<F: Sync + Send + FnMut(Point, &mut Pixel<C>)>( &mut self, region: Region, f: F, )

Iterate over mutable pixels in region, with a mutable closure

Source

pub fn crop(&self, roi: Region) -> Image<T, C>

Copy a region of an image to a new image

Source

pub fn copy_from_region( &mut self, offs: impl Into<Point>, other: &Image<T, C>, roi: Region, )

Copy into a region from another image starting at the given offset

Source

pub fn apply<U: Type, D: Color>( &mut self, filter: impl Filter<U, D, T, C>, input: &[&Image<U, D>], ) -> &mut Self

Apply a filter using an Image as output

Source

pub async fn apply_async<'a, U: Type, D: Color>( &mut self, mode: AsyncMode, filter: impl Filter<U, D, T, C> + Unpin, input: &[&Image<U, D>], ) -> &mut Self

Apply an async filter using an Image as output

Source

pub fn run_in_place(&mut self, filter: impl Filter<T, C>) -> &mut Self

Run a filter using the same Image as input and output

Source

pub fn run<U: Type, D: Color>( &self, filter: impl Filter<T, C, U, D>, output: Option<Meta<U, D>>, ) -> Image<U, D>

Run a filter using an Image as input

Source

pub async fn run_async<'a, U: 'a + Type, D: 'a + Color>( &self, mode: AsyncMode, filter: impl Filter<T, C, U, D> + Unpin, output: Option<Meta<U, D>>, ) -> Image<U, D>

Run an async filter using an Image as input

Source

pub fn convert<U: Type, D: Color>(&self) -> Image<U, D>

Convert image type/color

Source

pub fn convert_to<U: Type, D: Color>(&self, dest: &mut Image<U, D>)

Convert image type/color

Source

pub fn histogram(&self, bins: usize) -> Vec<Histogram>

Get image histogram

Source

pub fn gamma(&mut self, value: f64)

Gamma correction

Source

pub fn set_gamma_log(&mut self)

Convert to log RGB

Source

pub fn set_gamma_lin(&mut self)

Convert to linear RGB

Source

pub fn resize(&self, size: impl Into<Size>) -> Image<T, C>

Resize an image

Source

pub fn scale(&self, width: f64, height: f64) -> Image<T, C>

Scale an image

Source

pub fn data(&self) -> &[T]

Image data

Source

pub fn data_mut(&mut self) -> &mut [T]

Mutable image data

Source§

impl<T: Type, C: Color> Image<T, C>

Source

pub fn draw_text<'a>( &mut self, text: impl AsRef<str>, font: &Font<'a>, size: f32, pos: impl Into<Point>, color: &Pixel<C>, )

Draw text on image

Trait Implementations§

Source§

impl<T: Type, C: Color> Clone for Image<T, C>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<X: Into<Point>, T: Type, C: Color> Index<X> for Image<T, C>

Source§

type Output = [T]

The returned type after indexing.
Source§

fn index(&self, pt: X) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<X: Into<Point>, T: Type, C: Color> IndexMut<X> for Image<T, C>

Source§

fn index_mut(&mut self, pt: X) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Type, C: Color> PartialEq for Image<T, C>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToTexture<f32, Rgb> for Image<f32, Rgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_126u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<f32, Rgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<f32, Rgba> for Image<f32, Rgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_126u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<f32, Rgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<f32, Srgb> for Image<f32, Srgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_126u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<f32, Srgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<f32, Srgba> for Image<f32, Srgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_126u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<f32, Srgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<i16, Rgb> for Image<i16, Rgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_122u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<i16, Rgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<i16, Rgba> for Image<i16, Rgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_122u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<i16, Rgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<i16, Srgb> for Image<i16, Srgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_122u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<i16, Srgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<i16, Srgba> for Image<i16, Srgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_122u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<i16, Srgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u16, Rgb> for Image<u16, Rgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_123u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u16, Rgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u16, Rgba> for Image<u16, Rgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_123u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u16, Rgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u16, Srgb> for Image<u16, Srgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_123u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u16, Srgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u16, Srgba> for Image<u16, Srgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_123u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u16, Srgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u8, Rgb> for Image<u8, Rgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_121u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u8, Rgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u8, Rgba> for Image<u8, Rgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_121u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u8, Rgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u8, Srgb> for Image<u8, Srgb>

Source§

const COLOR: u32 = 6_407u32

OpenGL color
Source§

const KIND: u32 = 5_121u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u8, Srgb>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer
Source§

impl ToTexture<u8, Srgba> for Image<u8, Srgba>

Source§

const COLOR: u32 = 6_408u32

OpenGL color
Source§

const KIND: u32 = 5_121u32

OpenGL type
Source§

fn get_meta(&self) -> &Meta<u8, Srgba>

Get metadata
Source§

fn get_data(&self) -> &[u8]

Get data buffer
Source§

fn internal(&self) -> Result<u32, Error>

Get internal color type
Source§

fn create_image_texture( &self, gl: &Context, ) -> Result<ImageTexture<T, C>, Error>

Create ImageTexture
Source§

fn draw_image_texture( &self, gl: &Context, image_texture: &ImageTexture<T, C>, display_size: Size, offset: Point, ) -> Result<(), Error>

Draw the texture on the framebuffer

Auto Trait Implementations§

§

impl<T, C> Freeze for Image<T, C>

§

impl<T, C> !RefUnwindSafe for Image<T, C>

§

impl<T, C> Send for Image<T, C>

§

impl<T, C> Sync for Image<T, C>

§

impl<T, C> Unpin for Image<T, C>

§

impl<T, C> !UnwindSafe for Image<T, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.