aoclib::geometry::map

Struct Map

source
pub struct Map<Tile> { /* private fields */ }
Expand description

A Map keeps track of a tile grid.

Its coordinate system assumes that the origin is in the lower left, for compatibility with Direction.

While it is possible to clone a map, it is generally safe to assume that doing so is a sign that there’s a better approach possible.

§Entry Points

  • Map::new is most useful when the problem involves cartography.
  • When a map is provided as the day’s input, use Map::try_from

§Panics

Several internal methods assume that the width and height of the map can be represented in an i32. Very large maps may panic if that assumption is violated.

Implementations§

source§

impl<Tile> Map<Tile>

source

pub fn procedural( width: usize, height: usize, procedure: impl Fn(Point) -> Tile, ) -> Map<Tile>

Procedurally create a new Map from a function.

source

pub fn procedural_offset( offset: Point, width: usize, height: usize, procedure: impl Fn(Point) -> Tile, ) -> Map<Tile>

Procedurally create a new Map from a function, with an offset origin.

This offset can reduce dead space when the interesting part of a map is far from the origin.

source

pub fn width(&self) -> usize

Width of this map.

source

pub fn height(&self) -> usize

Height of this map.

source

pub fn offset(&self) -> Point

Offset of the lower left corner of this map from (0, 0).

source

pub fn low_x(&self) -> i32

Lowest x coordinate which is in bounds of this map.

source

pub fn high_x(&self) -> i32

Highest x coordinate which is in bounds of this map.

Note that this is inclusive; use ..= when using this to bound a range.

source

pub fn low_y(&self) -> i32

Lowest y coordinate which is in bounds of this map.

source

pub fn high_y(&self) -> i32

Highest y coordinate which is in bounds of this map.

Note that this is inclusive; use ..= when using this to bound a range.

source

pub fn bottom_left(&self) -> Point

The coordinates of the bottom left corner of this map.

This is inclusive; it is a valid index into the map.

source

pub fn top_left(&self) -> Point

The coordinates of the top left corner of this map.

This is inclusive; it is a valid index into the map.

source

pub fn bottom_right(&self) -> Point

The coordinates of the bottom right corner of this map.

This is inclusive; it is a valid index into the map.

source

pub fn top_right(&self) -> Point

The coordinates of the top right corner of this map.

This is inclusive; it is a valid index into the map.

source

pub fn iter(&self) -> impl Iterator<Item = (Point, &Tile)>

Iterate over the points and tiles of this map.

source

pub fn iter_mut(&mut self) -> impl Iterator<Item = (Point, &mut Tile)>

Iterate over the points of this tiles in this map, with mutable access to the tiles.

source

pub fn points(&self) -> impl Iterator<Item = Point>

Iterate over the points of this map without depending on the lifetime of self.

source

pub fn in_bounds(&self, point: Point) -> bool

true when a point is legal within the bounds of this map.

source

pub fn make_in_bounds(&self) -> impl Fn(Point) -> bool

Make a function which returns true when the parameter is within the bounds of this map, without depending on the lifetime of self.

source

pub fn adjacencies(&self, point: Point) -> impl Iterator<Item = Point>

Return an iterator of all legal points adjacent to the given point.

This iterator will return up to 8 elements; it includes diagonals.

source

pub fn orthogonal_adjacencies( &self, point: Point, ) -> impl Iterator<Item = Point>

Return an iterator of all legal points orthogonally adjacent to the given point,

This iterator will return up to 4 elements; it does not include diagonals.

source

pub fn make_adjacencies(&self, point: Point) -> impl Iterator<Item = Point>
where Tile: 'static,

Return an iterator of all legal points adjacent to the given point, without depending on the lifetime of self.

This iterator will return up to 8 elements; it includes diagonals.

This introduces a bound that the Tile type must not contain any references. It is also slightly less efficient than [self.adjacencies]. In general, that function should be preferred unless there are lifetime conflicts.

source

pub fn make_orthogonal_adjacencies( &self, point: Point, ) -> impl Iterator<Item = Point>
where Tile: 'static,

Return an iterator of all legal points orthogonally adjacent to the given point, without depending on the lifetime of self.

This iterator will return up to 4 elements; it does not include diagonals.

This introduces a bound that the Tile type must not contain any references. It is also slightly less efficient than [self.orthogonal_adjacencies]. In general, that function should be preferred unless there are lifetime conflicts.

source

pub fn project( &self, origin: Point, dx: i32, dy: i32, ) -> impl Iterator<Item = Point>

Return an iterator of all legal points arrived at by applying the given deltas to the origin.

The origin point is always the first item in this iteration.

source

pub fn edge(&self, direction: Direction) -> Edge

Create an iterator over the points on the edge of this map.

Note that this iterator returns the points which are coordinates for each point on the edge, not the items of this map. You can use the Iterator::map combinator to map it to items from the map, if desired.

The edge is traversed in increasing order. It is a std::iter::DoubleEndedIterator, though, so it can be reversed if desired.

The input direction indicates which edge should be traversed.

source

pub fn translate(&mut self, dx: i32, dy: i32)

Translate all points in this map by a given amount.

Completes in O(1).

§Example

Using the symbols X and O to indicate tiles, and . to indicate out-of-bounds space away from the origin, we start with this map:

XOOX
OXOX

After applying translate(2, 1), we end with this map:

..XOOX
..OXOX
......
source

pub fn convert_tile_type<NewTile>(self) -> Map<NewTile>
where Tile: Into<NewTile>,

Convert the underlying tile type of a map.

This produces a new map whose tiles are of a new underlying type.

source§

impl<Tile: Clone> Map<Tile>

source

pub fn extract_interesting_region( &self, is_interesting: impl Fn(Point, &Tile) -> bool, ) -> Self

Reduce the map to that portion which is interesting according to some user-defined metric.

This can be helpful when preparing visualizations.

source§

impl<Tile: Clone + Default> Map<Tile>

source

pub fn new(width: usize, height: usize) -> Map<Tile>

Create a new map of the specified dimensions.

Its lower left corner is at (0, 0).

source

pub fn new_offset(offset: Point, width: usize, height: usize) -> Map<Tile>

Create a new map of the specified dimensions.

Its lower left corner is at offset.

source

pub fn flip_vertical(&self) -> Map<Tile>

Create a copy of this map which has been flipped vertically: the axis of symmetry is horizontal.

This does not adjust the offset; the corners remain where they previously were.

source

pub fn flip_horizontal(&self) -> Map<Tile>

Create a copy of this map which has been flipped horizontally; the axis of symmetry is vertical.

This does not adjust the offset; the corners remain where they previously were.

source

pub fn rotate_left(&self) -> Map<Tile>

Create a copy of this map which has been rotated counter-clockwise.

This maintains the invariant that all points are in the positive quadrant, and assumes that the offset is (0, 0). If necessary, apply Self::translate before and after this operation to produce an appropriate new offset.

§Panics

If the offset is not (0, 0).

source

pub fn rotate_right(&self) -> Map<Tile>

Create a copy of this map which has been rotated clockwise.

This maintains the invariant that all points are in the positive quadrant, and assumes that the offset is (0, 0). If necessary, apply Self::translate before and after this operation to produce an appropriate new offset.

§Panics

If the offset is not (0, 0).

source§

impl<Tile> Map<Tile>
where Tile: Clone + DisplayWidth + FromStr, <Tile as FromStr>::Err: 'static + Error + Send + Sync,

source

pub fn try_from<R>(input: R) -> Result<Self, MapConversionErr>
where R: BufRead,

Try to convert the contents of a reader into a map.

We don’t actually impl<T, R> TryFrom<R> for Map<T> because there’s a coherence conflict with the stdlib blanket impl

impl<T, U> std::convert::TryFrom<U> for T where U: std::convert::Into<T>;

Because there’s a chance that R also implements Into<Map<T>>, we can’t do it.

That doesn’t stop us from doing it here, and implementing the official trait for a few concrete types

source§

impl<Tile> Map<Tile>
where Tile: Display + DisplayWidth,

source

pub fn to_string_with_override( &self, override_tiles: impl Fn(Point, &Tile) -> Option<String>, ) -> String

Produce a string from this Map, with certain tiles overridden.

This does not edit the map, just adjusts its presentation.

§Panics
  • If an override value’s returned string is not the same length as Tile::DISPLAY_WIDTH.
source§

impl<Tile> Map<Tile>
where Tile: ToRgb,

source

pub fn render(&self, output: &Path, style: Style) -> Result<(), RenderError>

Render this map as a still image into an output file.

Depends on the map-render feature.

The output image is a gif under all circumstances. It is useful, though unenforced, that the output file name matches *.gif.

source

pub fn prepare_animation( &self, output: &Path, frame_duration: Duration, style: Style, ) -> Result<Animation, RenderError>

Prepare an animation from this map.

Depends on the map-render feature.

This returns an Animation object which can have frames added to it. This method does not automatically render this Map frame to the Animation. This enables you to set up the animation ahead of time with dummy data.

The major constraint is that all subsequent maps added as frames must have dimensions identical to this Map’s.

The animation will loop infinitely, displaying each frame for frame_duration.

source§

impl<Tile> Map<Tile>
where Tile: Clone + ContextInto<Traversable, Context = ()>,

source

pub fn reachable_from( &self, point: Point, visit: impl FnMut(Point, &Tile) -> bool, )

Visit every non-obstructed tile reachable from the initial point.

If the visitor ever returns true, processing halts and no further points are visited.

source

pub fn navigate(&self, from: Point, to: Point) -> Option<Vec<Direction>>

navigate between the given points using A*

source§

impl<Tile: Clone + ContextInto<Traversable>> Map<Tile>

source

pub fn reachable_from_ctx( &self, context: &<Tile as ContextInto<Traversable>>::Context, point: Point, visit: impl FnMut(Point, &Tile) -> bool, )

Visit every non-obstructed tile reachable from the initial point.

If the visitor ever returns true, processing halts and no further points are visited.

source

pub fn navigate_ctx( &self, context: &<Tile as ContextInto<Traversable>>::Context, from: Point, to: Point, ) -> Option<Vec<Direction>>

navigate between the given points using A*

Trait Implementations§

source§

impl<Tile: Clone> Clone for Map<Tile>

source§

fn clone(&self) -> Map<Tile>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Tile> Debug for Map<Tile>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Tile: Default> Default for Map<Tile>

source§

fn default() -> Map<Tile>

Returns the “default value” for a type. Read more
source§

impl<Tile> Display for Map<Tile>
where Tile: Display + DisplayWidth,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Tile, Row> From<&[Row]> for Map<Tile>
where Tile: Clone, Row: AsRef<[Tile]>,

source§

fn from(source: &[Row]) -> Map<Tile>

Convert an input 2d array into a map.

Note that the input array must already be arranged with the y axis as the outer array and the orientation such that source[0][0] is the lower left corner of the map.

Panics if the input array is not rectangular.

source§

impl<Tile: Hash> Hash for Map<Tile>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Tile> Index<(usize, usize)> for Map<Tile>

source§

type Output = Tile

The returned type after indexing.
source§

fn index(&self, (x, y): (usize, usize)) -> &Tile

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

impl<Tile> Index<Point> for Map<Tile>

source§

fn index(&self, point: Point) -> &Tile

Panics if point.x < 0 || point.y < 0

source§

type Output = Tile

The returned type after indexing.
source§

impl<Tile> IndexMut<(usize, usize)> for Map<Tile>

source§

fn index_mut(&mut self, (x, y): (usize, usize)) -> &mut Tile

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

impl<Tile> IndexMut<Point> for Map<Tile>

source§

fn index_mut(&mut self, point: Point) -> &mut Tile

Panics if point.x < 0 || point.y < 0

source§

impl<Tile: PartialEq> PartialEq for Map<Tile>

source§

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

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

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<Tile> TryFrom<&Path> for Map<Tile>
where Tile: Clone + DisplayWidth + FromStr, <Tile as FromStr>::Err: 'static + Error + Send + Sync,

source§

fn try_from(path: &Path) -> Result<Self, Self::Error>

the input should be in natural graphical order: its first characters are the top left.

source§

type Error = Error

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

impl<Tile> TryFrom<&str> for Map<Tile>
where Tile: Clone + DisplayWidth + FromStr, <Tile as FromStr>::Err: 'static + Error + Send + Sync,

source§

fn try_from(input: &str) -> Result<Self, Self::Error>

the input should be in natural graphical order: its first characters are the top left.

source§

type Error = MapConversionErr

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

impl<Tile> TryFrom<File> for Map<Tile>
where Tile: Clone + DisplayWidth + FromStr, <Tile as FromStr>::Err: 'static + Error + Send + Sync,

source§

fn try_from(input: File) -> Result<Self, Self::Error>

the input should be in natural graphical order: its first characters are the top left.

source§

type Error = MapConversionErr

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

impl<Tile: Eq> Eq for Map<Tile>

Auto Trait Implementations§

§

impl<Tile> Freeze for Map<Tile>

§

impl<Tile> RefUnwindSafe for Map<Tile>
where Tile: RefUnwindSafe,

§

impl<Tile> Send for Map<Tile>
where Tile: Send,

§

impl<Tile> Sync for Map<Tile>
where Tile: Sync,

§

impl<Tile> Unpin for Map<Tile>
where Tile: Unpin,

§

impl<Tile> UnwindSafe for Map<Tile>
where Tile: UnwindSafe,

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, dst: *mut T)

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

impl<A, B> ContextFrom<A> for B
where B: From<A>,

source§

type Context = ()

source§

fn ctx_from(a: A, _position: Point, _context: &()) -> B

source§

impl<A, B> ContextInto<B> for A
where B: ContextFrom<A>,

source§

type Context = <B as ContextFrom<A>>::Context

source§

fn ctx_into( self, position: Point, context: &<A as ContextInto<B>>::Context, ) -> B

§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> IntoResult<T> for T

§

type Err = Infallible

§

fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>

§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T