pub struct Raster {
pub cols: usize,
pub rows: usize,
pub bands: usize,
pub x_min: f64,
pub y_min: f64,
pub cell_size_x: f64,
pub cell_size_y: f64,
pub nodata: f64,
pub data_type: DataType,
pub crs: CrsInfo,
pub metadata: Vec<(String, String)>,
pub data: RasterData,
}Expand description
A raster grid with one or more bands.
Data is stored in a typed contiguous buffer matching data_type.
Conversion to f64 happens only through accessor helpers when needed.
Layout: band-major, then row-major top-down within each band
(index = band * rows * cols + row * cols + col).
Fields§
§cols: usizeNumber of columns.
rows: usizeNumber of rows.
bands: usizeNumber of bands.
x_min: f64West edge X coordinate.
y_min: f64South edge Y coordinate.
cell_size_x: f64Cell width in map units (always positive).
cell_size_y: f64Cell height in map units (always positive, stored as absolute value).
nodata: f64No-data value.
data_type: DataTypeOn-disk data type (used for writing).
crs: CrsInfoSpatial reference.
metadata: Vec<(String, String)>Free-form key/value metadata.
data: RasterDataRaw data buffer, band-major then row-major top-down. Length = bands * cols * rows.
Implementations§
Source§impl Raster
impl Raster
Sourcepub fn new(cfg: RasterConfig) -> Self
pub fn new(cfg: RasterConfig) -> Self
Create a new raster from a RasterConfig, filling all cells with nodata.
Sourcepub fn from_data(cfg: RasterConfig, data: Vec<f64>) -> Result<Self>
pub fn from_data(cfg: RasterConfig, data: Vec<f64>) -> Result<Self>
Create a raster from a raw f64 data buffer.
§Errors
Returns RasterError::InvalidDimensions if data.len() != cols * rows * bands.
Sourcepub fn from_data_native(cfg: RasterConfig, data: RasterData) -> Result<Self>
pub fn from_data_native(cfg: RasterConfig, data: RasterData) -> Result<Self>
Create a raster from a typed data buffer.
§Errors
Returns RasterError::InvalidDimensions if data.len() != cols * rows * bands.
Returns RasterError::Other if cfg.data_type != data.data_type().
Sourcepub fn data_u8_mut(&mut self) -> Option<&mut [u8]>
pub fn data_u8_mut(&mut self) -> Option<&mut [u8]>
Typed fast-path mutable access to u8 storage.
Sourcepub fn data_i8_mut(&mut self) -> Option<&mut [i8]>
pub fn data_i8_mut(&mut self) -> Option<&mut [i8]>
Typed fast-path mutable access to i8 storage.
Sourcepub fn data_u16_mut(&mut self) -> Option<&mut [u16]>
pub fn data_u16_mut(&mut self) -> Option<&mut [u16]>
Typed fast-path mutable access to u16 storage.
Sourcepub fn data_i16_mut(&mut self) -> Option<&mut [i16]>
pub fn data_i16_mut(&mut self) -> Option<&mut [i16]>
Typed fast-path mutable access to i16 storage.
Sourcepub fn data_u32_mut(&mut self) -> Option<&mut [u32]>
pub fn data_u32_mut(&mut self) -> Option<&mut [u32]>
Typed fast-path mutable access to u32 storage.
Sourcepub fn data_i32_mut(&mut self) -> Option<&mut [i32]>
pub fn data_i32_mut(&mut self) -> Option<&mut [i32]>
Typed fast-path mutable access to i32 storage.
Sourcepub fn data_u64_mut(&mut self) -> Option<&mut [u64]>
pub fn data_u64_mut(&mut self) -> Option<&mut [u64]>
Typed fast-path mutable access to u64 storage.
Sourcepub fn data_i64_mut(&mut self) -> Option<&mut [i64]>
pub fn data_i64_mut(&mut self) -> Option<&mut [i64]>
Typed fast-path mutable access to i64 storage.
Sourcepub fn data_f32_mut(&mut self) -> Option<&mut [f32]>
pub fn data_f32_mut(&mut self) -> Option<&mut [f32]>
Typed fast-path mutable access to f32 storage.
Sourcepub fn data_f64_mut(&mut self) -> Option<&mut [f64]>
pub fn data_f64_mut(&mut self) -> Option<&mut [f64]>
Typed fast-path mutable access to f64 storage.
Sourcepub fn index(&self, band: isize, row: isize, col: isize) -> Option<usize>
pub fn index(&self, band: isize, row: isize, col: isize) -> Option<usize>
Return the flat buffer index for signed band, row, and column coordinates.
Returns None when coordinates are outside the raster bounds.
Sourcepub fn get(&self, band: isize, row: isize, col: isize) -> f64
pub fn get(&self, band: isize, row: isize, col: isize) -> f64
Get the value at signed pixel coordinates (band, row, col).
Returns the raster’s numeric nodata sentinel when coordinates are
out-of-bounds or the stored value is nodata.
Sourcepub fn get_opt(&self, band: isize, row: isize, col: isize) -> Option<f64>
pub fn get_opt(&self, band: isize, row: isize, col: isize) -> Option<f64>
Get the value at signed pixel coordinates (band, row, col) as
Option<f64>.
Returns None if coordinates are out-of-bounds or the value is nodata.
Sourcepub fn get_raw(&self, band: isize, row: isize, col: isize) -> Option<f64>
pub fn get_raw(&self, band: isize, row: isize, col: isize) -> Option<f64>
Get the raw value (including nodata) at signed pixel coordinates (band, row, col).
Returns None only on out-of-bounds.
Sourcepub fn set(
&mut self,
band: isize,
row: isize,
col: isize,
value: f64,
) -> Result<()>
pub fn set( &mut self, band: isize, row: isize, col: isize, value: f64, ) -> Result<()>
Set the value at signed pixel coordinates (band, row, col).
§Errors
Returns RasterError::OutOfBounds if coordinates are outside the grid.
Sourcepub fn set_unchecked(&mut self, band: isize, row: isize, col: isize, value: f64)
pub fn set_unchecked(&mut self, band: isize, row: isize, col: isize, value: f64)
Set a value at signed pixel coordinates, panicking on out-of-bounds. Convenience alias.
Sourcepub fn is_nodata(&self, v: f64) -> bool
pub fn is_nodata(&self, v: f64) -> bool
Returns true if v equals this raster’s nodata sentinel.
Sourcepub fn col_center_x(&self, col: isize) -> f64
pub fn col_center_x(&self, col: isize) -> f64
Cell-center X coordinate for signed column index col.
Sourcepub fn row_center_y(&self, row: isize) -> f64
pub fn row_center_y(&self, row: isize) -> f64
Cell-center Y coordinate for signed row index row (row 0 = north).
Sourcepub fn world_to_pixel(&self, x: f64, y: f64) -> Option<(isize, isize)>
pub fn world_to_pixel(&self, x: f64, y: f64) -> Option<(isize, isize)>
Convert geographic coordinates (x, y) to signed pixel indices (col, row).
Returns None if the point lies outside the raster extent.
Sourcepub fn assign_crs_epsg(&mut self, epsg: u32)
pub fn assign_crs_epsg(&mut self, epsg: u32)
Assign a CRS to this raster using an EPSG code.
Replaces the entire crs struct with a new CrsInfo containing only the EPSG code.
Any existing wkt or proj4 fields are cleared to ensure CRS consistency.
Sourcepub fn assign_crs_wkt(&mut self, wkt: &str)
pub fn assign_crs_wkt(&mut self, wkt: &str)
Assign a CRS to this raster using WKT text.
Replaces the entire crs struct with a new CrsInfo containing only the WKT definition.
Any existing epsg or proj4 fields are cleared to ensure CRS consistency.
Sourcepub fn reproject_to_epsg(
&self,
dst_epsg: u32,
resample: ResampleMethod,
) -> Result<Raster>
pub fn reproject_to_epsg( &self, dst_epsg: u32, resample: ResampleMethod, ) -> Result<Raster>
Reproject this raster to another EPSG CRS.
This MVP implementation uses an auto-derived output extent from transformed sampled source-boundary points (corners + edge densification) and supports nearest, bilinear, cubic, and Lanczos sampling.
For explicit output grid controls (cols, rows, extent), use
Raster::reproject_with_options.
§Errors
Returns an error when source/destination EPSG codes are unsupported, source CRS is missing, or transformed extents are invalid.
Sourcepub fn reproject_with_options(
&self,
options: &ReprojectOptions,
) -> Result<Raster>
pub fn reproject_with_options( &self, options: &ReprojectOptions, ) -> Result<Raster>
Reproject this raster using detailed output-grid options.
Sourcepub fn reproject_with_options_and_progress<F>(
&self,
options: &ReprojectOptions,
progress: F,
) -> Result<Raster>
pub fn reproject_with_options_and_progress<F>( &self, options: &ReprojectOptions, progress: F, ) -> Result<Raster>
Reproject this raster using detailed output-grid options and emit progress updates in the range [0, 1] as destination rows are completed.
Sourcepub fn reproject_with_crs(
&self,
src_crs: &Crs,
dst_crs: &Crs,
options: &ReprojectOptions,
) -> Result<Raster>
pub fn reproject_with_crs( &self, src_crs: &Crs, dst_crs: &Crs, options: &ReprojectOptions, ) -> Result<Raster>
Reproject this raster using caller-supplied source/destination CRS objects.
This advanced path bypasses the requirement that self.crs.epsg is set,
enabling workflows where CRS definitions are managed externally.
Note: options.dst_epsg is still used for output CrsInfo metadata and
EPSG-specific extent behavior (e.g., antimeridian handling for EPSG:4326).
Sourcepub fn reproject_with_crs_and_progress<F>(
&self,
src_crs: &Crs,
dst_crs: &Crs,
options: &ReprojectOptions,
progress: F,
) -> Result<Raster>
pub fn reproject_with_crs_and_progress<F>( &self, src_crs: &Crs, dst_crs: &Crs, options: &ReprojectOptions, progress: F, ) -> Result<Raster>
Reproject this raster with caller-supplied CRS objects and emit progress updates in the range [0, 1] as destination rows are completed.
Sourcepub fn reproject_to_epsg_nearest(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_nearest(&self, dst_epsg: u32) -> Result<Raster>
Convenience helper for nearest-neighbor reprojection.
Sourcepub fn reproject_to_epsg_bilinear(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_bilinear(&self, dst_epsg: u32) -> Result<Raster>
Convenience helper for bilinear reprojection.
Sourcepub fn reproject_to_epsg_cubic(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_cubic(&self, dst_epsg: u32) -> Result<Raster>
Convenience helper for cubic reprojection.
Sourcepub fn reproject_to_epsg_lanczos(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_lanczos(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using Lanczos interpolation.
Sourcepub fn reproject_to_epsg_average(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_average(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 mean resampling.
Sourcepub fn reproject_to_epsg_min(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_min(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 minimum resampling.
Sourcepub fn reproject_to_epsg_max(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_max(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 maximum resampling.
Sourcepub fn reproject_to_epsg_mode(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_mode(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 modal resampling.
Sourcepub fn reproject_to_epsg_median(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_median(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 median resampling.
Sourcepub fn reproject_to_epsg_stddev(&self, dst_epsg: u32) -> Result<Raster>
pub fn reproject_to_epsg_stddev(&self, dst_epsg: u32) -> Result<Raster>
Reproject to destination EPSG using 3x3 standard-deviation resampling.
Sourcepub fn reproject_to_match_grid(
&self,
target_grid: &Raster,
resample: ResampleMethod,
) -> Result<Raster>
pub fn reproject_to_match_grid( &self, target_grid: &Raster, resample: ResampleMethod, ) -> Result<Raster>
Reproject this raster to match another raster’s grid (CRS, extent, rows, cols).
The target_grid provides destination EPSG, output extent, and output
dimensions. This is useful when aligning products from multiple sources
onto a shared reference grid.
§Errors
Returns an error if target_grid.crs.epsg is missing or unsupported.
Sourcepub fn reproject_to_match_grid_and_progress<F>(
&self,
target_grid: &Raster,
resample: ResampleMethod,
progress: F,
) -> Result<Raster>
pub fn reproject_to_match_grid_and_progress<F>( &self, target_grid: &Raster, resample: ResampleMethod, progress: F, ) -> Result<Raster>
Reproject this raster to match another raster’s grid while emitting progress updates in the range [0, 1] as destination rows are completed.
Sourcepub fn reproject_to_match_resolution(
&self,
reference_grid: &Raster,
resample: ResampleMethod,
) -> Result<Raster>
pub fn reproject_to_match_resolution( &self, reference_grid: &Raster, resample: ResampleMethod, ) -> Result<Raster>
Reproject this raster using another raster’s CRS, resolution, and snap origin.
Unlike Raster::reproject_to_match_grid, this keeps the destination
extent auto-derived from the transformed source footprint, while aligning
that extent to the reference grid’s origin and pixel size.
§Errors
Returns an error if reference_grid.crs.epsg is missing or unsupported.
Sourcepub fn reproject_to_match_resolution_and_progress<F>(
&self,
reference_grid: &Raster,
resample: ResampleMethod,
progress: F,
) -> Result<Raster>
pub fn reproject_to_match_resolution_and_progress<F>( &self, reference_grid: &Raster, resample: ResampleMethod, progress: F, ) -> Result<Raster>
Reproject this raster while matching a reference raster’s resolution and snap origin, emitting progress updates in [0, 1].
Sourcepub fn reproject_to_match_resolution_in_epsg(
&self,
dst_epsg: u32,
reference_grid: &Raster,
resample: ResampleMethod,
) -> Result<Raster>
pub fn reproject_to_match_resolution_in_epsg( &self, dst_epsg: u32, reference_grid: &Raster, resample: ResampleMethod, ) -> Result<Raster>
Reproject this raster to an explicit destination EPSG while matching a reference raster’s resolution and snap origin.
If reference_grid is in a different CRS than dst_epsg, the
reference snap origin and per-axis cell sizes are transformed to
destination CRS using local axis steps at the reference origin.
§Errors
Returns an error if reference/destination EPSG values are missing or unsupported, or if transformed reference resolution is invalid.
Sourcepub fn reproject_to_match_resolution_in_epsg_and_progress<F>(
&self,
dst_epsg: u32,
reference_grid: &Raster,
resample: ResampleMethod,
progress: F,
) -> Result<Raster>
pub fn reproject_to_match_resolution_in_epsg_and_progress<F>( &self, dst_epsg: u32, reference_grid: &Raster, resample: ResampleMethod, progress: F, ) -> Result<Raster>
Reproject this raster to an explicit destination EPSG while matching a reference raster’s transformed resolution/snap, emitting progress in [0, 1].
Sourcepub fn sample_world(
&self,
band: isize,
x: f64,
y: f64,
method: ResampleMethod,
nodata_policy: NodataPolicy,
) -> Option<f64>
pub fn sample_world( &self, band: isize, x: f64, y: f64, method: ResampleMethod, nodata_policy: NodataPolicy, ) -> Option<f64>
Sample a raster value at world coordinates using the selected resampling method.
Sourcepub fn statistics(&self) -> Statistics
pub fn statistics(&self) -> Statistics
Compute basic statistics over all valid (non-nodata) cells.
Sourcepub fn statistics_with_mode(
&self,
mode: StatisticsComputationMode,
) -> Statistics
pub fn statistics_with_mode( &self, mode: StatisticsComputationMode, ) -> Statistics
Compute basic statistics over all valid (non-nodata) cells using a selected computation path.
Sourcepub fn statistics_band(&self, band: isize) -> Result<Statistics>
pub fn statistics_band(&self, band: isize) -> Result<Statistics>
Compute basic statistics over all valid (non-nodata) cells in one band.
Sourcepub fn statistics_band_with_mode(
&self,
band: isize,
mode: StatisticsComputationMode,
) -> Result<Statistics>
pub fn statistics_band_with_mode( &self, band: isize, mode: StatisticsComputationMode, ) -> Result<Statistics>
Compute basic statistics over one band using a selected computation path.
Sourcepub fn band_slice(&self, band: isize) -> Vec<f64>
pub fn band_slice(&self, band: isize) -> Vec<f64>
Return a copy of one full band as row-major values.
Sourcepub fn set_band_slice(&mut self, band: isize, values: &[f64]) -> Result<()>
pub fn set_band_slice(&mut self, band: isize, values: &[f64]) -> Result<()>
Set one full band from row-major values.
Sourcepub fn row_slice(&self, band: isize, row: isize) -> Vec<f64>
pub fn row_slice(&self, band: isize, row: isize) -> Vec<f64>
Return a slice of the raw data for signed (band, row).
Sourcepub fn set_row_slice(
&mut self,
band: isize,
row: isize,
values: &[f64],
) -> Result<()>
pub fn set_row_slice( &mut self, band: isize, row: isize, values: &[f64], ) -> Result<()>
Set all values in signed (band, row) from an f64 slice.
Sourcepub fn iter_valid(
&self,
) -> impl Iterator<Item = (isize, isize, isize, f64)> + '_
pub fn iter_valid( &self, ) -> impl Iterator<Item = (isize, isize, isize, f64)> + '_
Iterate over signed (band, row, col, value) for all valid cells.
Sourcepub fn iter_valid_band(
&self,
band: isize,
) -> Result<Box<dyn Iterator<Item = (isize, isize, f64)> + '_>>
pub fn iter_valid_band( &self, band: isize, ) -> Result<Box<dyn Iterator<Item = (isize, isize, f64)> + '_>>
Iterate over signed (row, col, value) for all valid cells in one band.
Sourcepub fn iter_band_rows(
&self,
band: isize,
) -> Result<Box<dyn Iterator<Item = Vec<f64>> + '_>>
pub fn iter_band_rows( &self, band: isize, ) -> Result<Box<dyn Iterator<Item = Vec<f64>> + '_>>
Iterate over row vectors (Vec<f64>) for one band from north to south.
Sourcepub fn for_each_band_row_mut<F>(&mut self, band: isize, f: F) -> Result<()>
pub fn for_each_band_row_mut<F>(&mut self, band: isize, f: F) -> Result<()>
Traverse mutable native row slices for one band from north to south.
This is a zero-allocation fast path for in-place row-wise processing.
The callback receives (row_index, typed_row_slice).
Sourcepub fn for_each_band_row<F>(&self, band: isize, f: F) -> Result<()>
pub fn for_each_band_row<F>(&self, band: isize, f: F) -> Result<()>
Traverse immutable native row slices for one band from north to south.
This is a zero-allocation fast path for read-only row-wise processing.
The callback receives (row_index, typed_row_slice).
Sourcepub fn fill_nodata(&mut self)
pub fn fill_nodata(&mut self)
Fill all cells with the nodata value.
Sourcepub fn map_valid<F: Fn(f64) -> f64>(&mut self, f: F)
pub fn map_valid<F: Fn(f64) -> f64>(&mut self, f: F)
Apply a function to every valid (non-nodata) cell value in-place.
Sourcepub fn map_valid_band<F: Fn(f64) -> f64>(
&mut self,
band: isize,
f: F,
) -> Result<()>
pub fn map_valid_band<F: Fn(f64) -> f64>( &mut self, band: isize, f: F, ) -> Result<()>
Apply a function to every valid (non-nodata) cell value in one band in-place.
Sourcepub fn replace(&mut self, from: f64, to: f64)
pub fn replace(&mut self, from: f64, to: f64)
Replace all occurrences of from with to in the data buffer.
Sourcepub fn replace_band(&mut self, band: isize, from: f64, to: f64) -> Result<()>
pub fn replace_band(&mut self, band: isize, from: f64, to: f64) -> Result<()>
Replace all occurrences of from with to in one band.
Sourcepub fn read<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn read<P: AsRef<Path>>(path: P) -> Result<Self>
Read a raster from path, detecting the format automatically.
Sourcepub fn read_with_format<P: AsRef<Path>>(
path: P,
fmt: RasterFormat,
) -> Result<Self>
pub fn read_with_format<P: AsRef<Path>>( path: P, fmt: RasterFormat, ) -> Result<Self>
Read a raster from path using the specified format.
Sourcepub fn write<P: AsRef<Path>>(&self, path: P, fmt: RasterFormat) -> Result<()>
pub fn write<P: AsRef<Path>>(&self, path: P, fmt: RasterFormat) -> Result<()>
Write this raster to path, detecting the format from the extension.
Sourcepub fn write_auto<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn write_auto<P: AsRef<Path>>(&self, path: P) -> Result<()>
Write this raster, auto-detecting the format from the file extension.
Sourcepub fn write_geotiff_with_options<P: AsRef<Path>>(
&self,
path: P,
opts: &GeoTiffWriteOptions,
) -> Result<()>
pub fn write_geotiff_with_options<P: AsRef<Path>>( &self, path: P, opts: &GeoTiffWriteOptions, ) -> Result<()>
Write this raster as GeoTIFF/BigTIFF/COG using typed options.
Sourcepub fn write_cog<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn write_cog<P: AsRef<Path>>(&self, path: P) -> Result<()>
Write this raster as a Cloud-Optimized GeoTIFF (COG) using convenience defaults.
Defaults:
- compression: Deflate
- BigTIFF: false
- COG tile size: 512
Sourcepub fn write_cog_with_tile_size<P: AsRef<Path>>(
&self,
path: P,
tile_size: u32,
) -> Result<()>
pub fn write_cog_with_tile_size<P: AsRef<Path>>( &self, path: P, tile_size: u32, ) -> Result<()>
Write this raster as a Cloud-Optimized GeoTIFF (COG) using convenience defaults and a custom tile size.
Defaults:
- compression: Deflate
- BigTIFF: false
- COG tile size:
tile_size
Sourcepub fn write_cog_with_options<P: AsRef<Path>>(
&self,
path: P,
opts: &CogWriteOptions,
) -> Result<()>
pub fn write_cog_with_options<P: AsRef<Path>>( &self, path: P, opts: &CogWriteOptions, ) -> Result<()>
Write this raster as a Cloud-Optimized GeoTIFF (COG) using COG-focused typed options.
Any option set to None uses convenience defaults:
- compression: Deflate
- BigTIFF: false
- COG tile size: 512
Sourcepub fn write_jpeg2000_with_options<P: AsRef<Path>>(
&self,
path: P,
opts: &Jpeg2000WriteOptions,
) -> Result<()>
pub fn write_jpeg2000_with_options<P: AsRef<Path>>( &self, path: P, opts: &Jpeg2000WriteOptions, ) -> Result<()>
Write this raster as JPEG2000/GeoJP2 using typed options.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Raster
impl RefUnwindSafe for Raster
impl Send for Raster
impl Sync for Raster
impl Unpin for Raster
impl UnsafeUnpin for Raster
impl UnwindSafe for Raster
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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