Skip to main content

Map

Struct Map 

Source
pub struct Map { /* private fields */ }
Expand description

A map: its style, its camera, and the updates it publishes for its renderer.

The map publishes its state for a renderer in an update slot, which a renderer reads through update_reader and reports back to through renderer_events. The style is an Arc<Style> version: edit_style makes the next one and publishes it at once. The style’s loader and the renderer report to the map through queues, which the map handles only in process_events (which drain_events calls): an owner calls it once per phase, before the commands that should see what was reported, such as a camera command that should land after the style’s default camera. What the map reports to its owner waits in another queue, for drain_events. An owner sets a waker (set_waker) that schedules those calls on its thread.

Implementations§

Source§

impl Map

Source

pub fn new(map_options: MapOptions, pool: &Pool) -> Result<Map, Error>

A map with a Loader of its own for the default ResourceOptions, whose background work runs on pool.

Fails with ErrorKind::InvalidArgument for an empty map_options.size.

Source

pub fn with_resource_options( map_options: MapOptions, resource_options: &ResourceOptions, pool: &Pool, ) -> Result<Map, Error>

A map with a Loader of its own for resource_options, on pool.

Source

pub fn with_file_source( file_source: Arc<dyn FileSource>, map_options: MapOptions, pool: &Pool, ) -> Result<Map, Error>

A map whose resources come from file_source, on pool.

Source

pub fn with_registry( file_source: Arc<dyn FileSource>, map_options: MapOptions, registry: Arc<StyleRegistry>, pool: &Pool, ) -> Result<Map, Error>

A map whose resources come from file_source and whose style parses against registry, on pool. The other constructors use the built-in registrations.

The renderer that draws the map must be given a registry filled by the same calls as registry (crate::Registry::style): it finds a layer’s type by name, and draws no layer whose type it lacks.

Source

pub fn pool(&self) -> &Pool

Where the map’s background work runs.

Source

pub fn update_reader(&self) -> UpdateReader

A reader of the updates that the map publishes for its renderer.

Source

pub fn renderer_events(&self) -> RendererEvents

The queue that the map’s renderer reports its events to.

Source

pub fn begin_command_group(&mut self)

Holds the map’s updates back from its renderer until the matching end_command_group, so the changes in between show in the same frame. Groups nest, and the changes show when the outermost group ends.

Source

pub fn end_command_group(&mut self) -> Result<(), Error>

Ends the group that begin_command_group began. Fails with ErrorKind::InvalidState when no group is open.

Source

pub fn command_group_depth(&self) -> u32

How many command groups are open.

Source

pub fn hold_updates(&mut self)

Holds the map’s updates back from its renderer, as a command group does, until release_updates. The hold is apart from the groups: it doesn’t nest, and command_group_depth doesn’t count it.

Source

pub fn release_updates(&mut self)

Ends the hold that hold_updates began. The changes show unless a command group still holds them.

Source

pub fn set_waker(&mut self, waker: Option<Waker>)

Sets the waker that runs, on any thread, when the map has events to handle or to drain. It must not call the map: it schedules a call of drain_events or process_events on the map’s thread, as by posting to the owner’s Queue.

Source

pub fn has_reports(&self) -> bool

Whether the style or the renderer reported something that process_events hasn’t handled. A report counts once it is queued, though its waker may not have run yet.

Source

pub fn set_reports_waker(&mut self, waker: Option<Waker>)

Sets a waker as set_waker does, that runs only when the style or the renderer reports something for the map to handle, which can come from any thread. The events that the map’s own calls report don’t run it, for an owner that drains them after each call.

Source

pub fn process_events(&mut self)

Handles what the style and the renderer reported since the last call: loads, frames, errors and missing images. The map’s reactions, such as an update for the renderer or a still image’s callback, run here, and its events wait for drain_events.

Source

pub fn drain_events(&mut self) -> Vec<MapEvent>

Handles what the style and the renderer reported, as process_events does, and takes the map’s events, oldest first.

Source

pub fn drain_command_ends(&mut self) -> Drain<'_, CommandEnd> ⓘ

Drains the ends of the camera commands that ended since the last call, oldest first: each command’s end comes once, unless the map drops while the command runs (see close_camera). They come with the camera events of the same calls, which drain_events takes. The map keeps its buffer for the ends that come next.

Source

pub fn record_change(&mut self)

Counts a change to state that the map’s owner keeps for the map, such as which of its events a runtime reports, in the map’s generation.

Source

pub fn jump_to(&mut self, camera: &CameraOptions)

Source

pub fn render_still(&mut self) -> Result<(), Error>

Asks for a still image: the map’s renderer draws frames until one has everything loaded, and take_still_image then reports it. Fails with ErrorKind::InvalidState for a continuous map and while another still image is on its way, and with the style’s error when it failed to load.

Source

pub fn take_still_image(&mut self) -> Option<Result<(), Error>>

How the still image that render_still asked for ended, once it has: Ok once a complete frame rendered, or why the image failed. The map handles its renderer’s reports in process_events, so call that first.

Source

pub fn pending_still_image(&self) -> Option<u64>

The still image request that waits for a frame, as the still_image_request_id of the updates that ask for it, or None once it ended.

Source

pub fn trigger_repaint(&mut self)

Triggers a repaint.

Source

pub fn repaint_at(&self) -> Option<Instant>

When the map changes next on its own, though its last frame asked for no other: the owner calls trigger_repaint then, by the frame clock. None once an update went out since.

Source

pub fn set_feature_state( &mut self, source_id: &str, source_layer_id: Option<&str>, feature_id: &str, state: FeatureState, ) -> bool

Merges state into the state of the feature feature_id of the source source_id, in its source layer source_layer_id: its keys replace the same keys of the feature’s state, and the other keys stay. None, like the empty string, names no source layer.

The map keeps the state until it is removed or a style loads, which removes the state of every source, and sends it to the renderer with its updates. Publishes an update when the state changes. Returns whether it changed.

Source

pub fn feature_state( &self, source_id: &str, source_layer_id: Option<&str>, feature_id: &str, ) -> FeatureState

The state of the feature feature_id of the source source_id, in its source layer source_layer_id, empty when it has none.

Source

pub fn remove_feature_state( &mut self, source_id: &str, source_layer_id: Option<&str>, feature_id: Option<&str>, state_key: Option<&str>, ) -> bool

Removes the state of the feature feature_id of the source source_id, in its source layer source_layer_id: only its key state_key when there is one, and that of every feature in the source layer without feature_id. Publishes an update when the state changes. Returns whether it changed.

Source

pub fn remove_source_feature_state(&mut self, source_id: &str) -> bool

Removes the state of every feature of the source source_id, as when the source leaves the style. Publishes an update when the state changes. Returns whether it changed.

Source

pub fn style(&self) -> &Arc<Style> ⓘ

The map’s style.

Source

pub fn edit_style<R, E>( &mut self, edit: impl FnOnce(&mut Style) -> Result<R, E>, ) -> Result<R, E>

Edits the style: edit changes the next version of it, and the map publishes that version for the renderer if anything changed. A version that edit left as it was stays the same Arc, so it publishes nothing. Returns what edit returns, and keeps what it changed before it failed.

Each source that the edit changed, rather than added or removed, reports MapEvent::SourceChanged.

Source

pub fn edit_loaded_style<R>( &mut self, edit: impl FnOnce(&mut Style) -> Result<R, Error>, ) -> Result<R, Error>

As edit_style, but fails with ErrorKind::InvalidState (“style is not loaded”) until a style document parsed, and from the start of each load_style_url until its document parses: the parse replaces the whole style, so an edit made before it would be lost.

Source

pub fn style_document_loaded(&self) -> bool

Whether a style document parsed, and no load_style_url began since.

Source

pub fn add_source(&mut self, source: Source) -> Result<(), Error>

Adds source to the style, last, and starts loading its description. Fails with ErrorKind::AlreadyExists if the style has a source with its id, and with InvalidArgument if a layer that names its id can’t draw a source of its kind.

Source

pub fn add_source_json(&mut self, id: &str, json: &str) -> Result<(), Error>

Adds the source that json describes, with the ID id.

Fails with ErrorKind::InvalidState while the style isn’t loaded, with AlreadyExists if the style has a source named id, and with InvalidArgument if json isn’t a valid source or a layer that names id can’t draw it.

Source

pub fn remove_source(&mut self, id: &str) -> Option<Source>

Removes the source id from the style and gives it back, unless a layer uses it, which logs a warning.

Source

pub fn source(&self, id: &str) -> Option<&Source>

The style’s source id.

Source

pub fn sources(&self) -> impl Iterator<Item = &Source>

The style’s sources, in the order they were added.

Source

pub fn load_style_json(&mut self, json: &str)

Loads the style document json, which replaces the style, and cancels a URL load. A document that doesn’t parse leaves the style as it was and reports MapEvent::LoadingFailed.

Source

pub fn load_style_url(&mut self, url: &str)

Fetches the style document at url, which replaces the style when it arrives and parses. The style stays meanwhile, but isn’t loaded.

Source

pub fn style_url(&self) -> Option<&str>

The URL of the style document, or None for a style loaded from JSON or none at all.

Source

pub fn set_fallback_font_faces(&mut self, json: &str) -> Result<(), Error>

Sets the font faces that every font stack falls back to, for the style documents that load after this call. They shape the text that glyph PBFs can’t shape, or all the text of a style without glyph PBFs, and draw the glyphs that come from local fonts (LocalGlyphs) before the device’s fonts do.

json is an array of font files, each an object with a url and an optional unicode-range, as in a font face of a style’s font-faces. It fails with ErrorKind::InvalidArgument if json isn’t such an array. Without a font-face shaper, the map ignores them, as it ignores a style’s font-faces.

Source

pub fn set_fallback_font_face_list(&mut self, faces: FontFaces)

set_fallback_font_faces with faces an app has made, such as FontFace::fallback(url, ranges).with_data(bytes) for a font file it holds in memory, or FontFace::system, for the device’s fonts that the renderer’s LocalGlyphs::chooser chooses.

Source

pub fn last_style_error(&self) -> Option<&Error>

The last error of a sprite or a source of the style since its load began, which fails still images.

Source

pub fn cancel_transitions(&mut self)

Source

pub fn cancel_transitions_with_id(&mut self, transition_id: u64)

Cancels the commands whose AnimationOptions::transition_id equals transition_id, and leaves the others running. Requests an update only when a command ended.

Source

pub fn apply_camera_delta( &mut self, delta: &CameraDelta, ) -> Result<CameraCommandId, CameraError>

Moves the camera relative to where it is, as a gesture does (the C API’s mln_map_apply_camera_delta): a pan, a zoom, turn and tilt around an anchor, a gesture phase, and the momentum a gesture’s end continues with. See CameraDelta. Returns the command, whose end drain_command_ends reports.

Source

pub fn update_camera(&mut self, update: &CameraUpdate) -> CameraCommandId

Moves the camera to absolute values, by a jump, an ease or a flight, as a command or as part of a gesture (the C API’s mln_map_update_camera). See CameraUpdate. Returns the command, whose end drain_command_ends reports.

Source

pub fn close_camera(&mut self)

Ends the running camera commands as closed, as when the map closes, which drain_command_ends reports. An owner that waits for the commands’ ends calls it before it drops the map.

Source

pub fn set_globe_free_bearing(&mut self, free_bearing: bool)

Sets whether drags and zooms on the globe turn the bearing (Viewport::globe_free_bearing), as set_viewport does.

Source

pub fn set_frame_time(&mut self, time: Option<Instant>)

Samples the camera’s animations at the host’s frame time, from now on, and starts new ones from it: call it at the start of each frame with Instant::now(), before rendering. One older than STALE_FRAME_TIME counts as unset, so commands made while the host isn’t drawing start now. If an animation runs, the map updates for this frame at once. None goes back to sampling at Instant::now() whenever the map updates. Still images ignore it. See Transform::set_frame_time.

Source

pub fn frame_clock(&self) -> FrameClock

The clock that set_frame_time sets, for a host that sets it from the thread that draws, without updating the map. It then calls sample_frame for each frame that an animation runs in.

Source

pub fn sample_frame(&mut self)

Updates the map for a frame at the frame clock’s time, if an animation runs.

Source

pub fn lat_lng_bounds_for_camera( &self, camera: &CameraOptions, ) -> Result<LatLngBounds, Error>

The bounds of the area the map shows from camera. Fails with ErrorKind::InvalidArgument for a camera whose corners have no LatLng.

Over terrain, the area is where the view meets the plane through the camera’s center, as camera_for_lat_lngs fits it.

Source

pub fn move_by( &mut self, point: &ScreenCoordinate, animation: &AnimationOptions, ) -> Result<(), Error>

Fails with ErrorKind::InvalidArgument for a NaN or infinite point.

Source

pub fn camera_for_lat_lng_bounds( &self, bounds: &LatLngBounds, padding: &EdgeInsets, bearing: Option<f64>, pitch: Option<f64>, ) -> Result<CameraOptions, Error>

The camera that fits bounds in the view, inset by padding, at bearing and pitch (the current ones for None). Fails with ErrorKind::InvalidArgument for a center that has no LatLng (padding that pushes it to infinity).

Source

pub fn camera_for_lat_lngs( &self, lat_lngs: &[LatLng], padding: &EdgeInsets, bearing: Option<f64>, pitch: Option<f64>, ) -> Result<CameraOptions, Error>

The camera that fits every point of lat_lngs in the view, inset by padding, at bearing and pitch (the current ones for None). Fails as camera_for_lat_lng_bounds does.

On the flat map the points stand at sea level, and the center keeps its altitude. Over terrain, where the center will stand isn’t known until the ground there draws, so the points fit as if they stood as high as the center: the camera shows them inside the padding at that height, whatever altitude it comes to. Points on higher ground can show past the padding, and those on lower ground inside it.

Source

pub fn camera_for_geometry( &self, geometry: &Geometry<f64>, padding: &EdgeInsets, bearing: Option<f64>, pitch: Option<f64>, ) -> Result<CameraOptions, Error>

The camera that fits every point of geometry (x longitude, y latitude), as camera_for_lat_lngs fits them. Fails as that does, and with ErrorKind::InvalidArgument for a point with no LatLng (an infinite or NaN coordinate, or a latitude beyond ±90°).

Source

pub fn lat_lng_bounds_for_camera_unwrapped( &self, camera: &CameraOptions, ) -> Result<LatLngBounds, Error>

The bounds of the area the map shows from camera, with the corners unwrapped toward the center, so that the bounds can cross the antimeridian. Fails as lat_lng_bounds_for_camera does.

Source

pub fn set_bounds(&mut self, options: &BoundOptions) -> Result<(), Error>

Source

pub fn set_viewport(&mut self, viewport: &Viewport)

Sets how the map orients and constrains its view, every setting at once.

Source

pub fn set_size(&mut self, size: Size) -> Result<(), Error>

Fails with ErrorKind::InvalidArgument for an empty size.

Source

pub fn set_pixel_ratio(&mut self, pixel_ratio: f32) -> Result<(), Error>

Sets the map’s pixel ratio: device pixels per logical pixel. The renderer draws the next frame at the new ratio and lays the loaded tiles out again without loading them, and the style loads its sprites again where the ratio picks their other resolution.

Fails with ErrorKind::InvalidArgument for a ratio that isn’t finite and positive.

Source

pub fn set_projection_mode(&mut self, options: &ProjectionMode)

Source

pub fn transform_state(&self) -> &TransformState

The camera, the viewport and the limits the camera moves within.

Source

pub fn set_tile_settings(&mut self, tile: &TileSettings)

Sets how the map picks the tiles to load, every setting at once, in the units that its snapshot reports them. Publishes an update when they change.

Source

pub fn pixel_for_lat_lng(&self, lat_lng: &LatLng) -> ScreenCoordinate

The screen point of lat_lng, in the copy of the world nearest the camera’s center, standing on the ground the map draws: over terrain, at the height the renderer drew the ground at there (Self::ground), or at the center’s altitude where it drew none; on the flat map, at sea level. A location that nearer ground hides still has the point where its ground draws.

Source

pub fn lat_lng_for_pixel( &self, pixel: &ScreenCoordinate, wrap_mode: WrapMode, ) -> Result<LatLng, Error>

The location that pixel shows on the ground the map draws: over terrain, where its line of sight first meets the ground the renderer drew (Self::ground), or, where it meets none, as in the sky, the plane at the center’s altitude; on the flat map, sea level. pixel_for_lat_lng takes the location back to the pixel, but above the horizon of the plane, which the line of sight doesn’t meet. Fails with ErrorKind::InvalidArgument for a NaN or infinite pixel.

Source

pub fn lat_lngs_for_pixels( &self, screen_coords: &[ScreenCoordinate], wrap_mode: WrapMode, ) -> Result<Vec<LatLng>, Error>

lat_lng_for_pixel of each pixel. Fails as that does for any of them.

Source

pub fn set_free_camera_options(&mut self, camera: &FreeCameraOptions)

Places the camera by its position and orientation, and cancels the running camera commands. A NaN position, or a NaN or zero-length orientation, is ignored; the position’s height is clamped to the zoom range.

Source

pub fn set_center_clamped_to_ground(&mut self, clamped: bool)

Sets whether the center stands on the terrain, at its height under the center (Viewport::center_clamped_to_ground), as set_viewport does. Turning it on stands a camera at rest on the ground at once, without camera events; turning it off leaves the altitude where it is.

Source

pub fn center_clamped_to_ground(&self) -> bool

Whether the center stands on the terrain.

Source

pub fn ground(&self) -> Option<Arc<dyn Elevation>>

The ground of the style’s terrain as the renderer last drew it, which the camera stands on and the map’s conversions meet (pixel_for_lat_lng). None while the map draws flat: without terrain, in tile mode, and until the renderer draws the terrain.

Source

pub fn generation(&self) -> u64

Grows with each change to the map’s state: each call that changes it, and each change that loading, rendering and animations make.

Source

pub fn update_generation(&self) -> u64

Counts the updates that the map has published for its renderer. An update that a command group holds back counts when it shows.

Source

pub fn pending_update_generation(&self) -> u64

The generation of the update that shows the map’s changes so far: update_generation, or while a command group holds an update back, the one that the outermost group’s end shows.

Source

pub fn snapshot(&self) -> MapSnapshot

Copies the map’s state.

Source

pub fn dump_debug_logs(&self)

Logs the style’s sources and their state.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Map

§

impl !Send for Map

§

impl !Sync for Map

§

impl !UnwindSafe for Map

§

impl Forget for Map

§

impl Freeze for Map

§

impl Move for Map

§

impl Unpin for Map

§

impl UnsafeUnpin for Map

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> Conv for T

Source§

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

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

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

Source§

impl<T> FmtForward for T

Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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> Pipe for T
where T: ?Sized,

Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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

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

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

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

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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> TryConv for T

Source§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool