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
impl Map
Sourcepub fn new(map_options: MapOptions, pool: &Pool) -> Result<Map, Error>
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.
Sourcepub fn with_resource_options(
map_options: MapOptions,
resource_options: &ResourceOptions,
pool: &Pool,
) -> Result<Map, Error>
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.
Sourcepub fn with_file_source(
file_source: Arc<dyn FileSource>,
map_options: MapOptions,
pool: &Pool,
) -> Result<Map, Error>
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.
Sourcepub fn with_registry(
file_source: Arc<dyn FileSource>,
map_options: MapOptions,
registry: Arc<StyleRegistry>,
pool: &Pool,
) -> Result<Map, Error>
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.
Sourcepub fn update_reader(&self) -> UpdateReader
pub fn update_reader(&self) -> UpdateReader
A reader of the updates that the map publishes for its renderer.
Sourcepub fn renderer_events(&self) -> RendererEvents
pub fn renderer_events(&self) -> RendererEvents
The queue that the map’s renderer reports its events to.
Sourcepub fn begin_command_group(&mut self)
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.
Sourcepub fn end_command_group(&mut self) -> Result<(), Error>
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.
Sourcepub fn command_group_depth(&self) -> u32
pub fn command_group_depth(&self) -> u32
How many command groups are open.
Sourcepub fn hold_updates(&mut self)
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.
Sourcepub fn release_updates(&mut self)
pub fn release_updates(&mut self)
Ends the hold that hold_updates began. The
changes show unless a command group still holds them.
Sourcepub fn set_waker(&mut self, waker: Option<Waker>)
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.
Sourcepub fn has_reports(&self) -> bool
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.
Sourcepub fn set_reports_waker(&mut self, waker: Option<Waker>)
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.
Sourcepub fn process_events(&mut self)
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.
Sourcepub fn drain_events(&mut self) -> Vec<MapEvent>
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.
Sourcepub fn drain_command_ends(&mut self) -> Drain<'_, CommandEnd> ⓘ
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.
Sourcepub fn record_change(&mut self)
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.
pub fn jump_to(&mut self, camera: &CameraOptions)
Sourcepub fn render_still(&mut self) -> Result<(), Error>
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.
Sourcepub fn take_still_image(&mut self) -> Option<Result<(), Error>>
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.
Sourcepub fn pending_still_image(&self) -> Option<u64>
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.
Sourcepub fn trigger_repaint(&mut self)
pub fn trigger_repaint(&mut self)
Triggers a repaint.
Sourcepub fn repaint_at(&self) -> Option<Instant>
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.
Sourcepub fn set_feature_state(
&mut self,
source_id: &str,
source_layer_id: Option<&str>,
feature_id: &str,
state: FeatureState,
) -> bool
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.
Sourcepub fn feature_state(
&self,
source_id: &str,
source_layer_id: Option<&str>,
feature_id: &str,
) -> FeatureState
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.
Sourcepub fn remove_feature_state(
&mut self,
source_id: &str,
source_layer_id: Option<&str>,
feature_id: Option<&str>,
state_key: Option<&str>,
) -> bool
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.
Sourcepub fn remove_source_feature_state(&mut self, source_id: &str) -> bool
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.
Sourcepub fn edit_style<R, E>(
&mut self,
edit: impl FnOnce(&mut Style) -> Result<R, E>,
) -> Result<R, E>
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.
Sourcepub fn edit_loaded_style<R>(
&mut self,
edit: impl FnOnce(&mut Style) -> Result<R, Error>,
) -> Result<R, Error>
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.
Sourcepub fn style_document_loaded(&self) -> bool
pub fn style_document_loaded(&self) -> bool
Whether a style document parsed, and no
load_style_url began since.
Sourcepub fn add_source(&mut self, source: Source) -> Result<(), Error>
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.
Sourcepub fn add_source_json(&mut self, id: &str, json: &str) -> Result<(), Error>
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.
Sourcepub fn remove_source(&mut self, id: &str) -> Option<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.
Sourcepub fn sources(&self) -> impl Iterator<Item = &Source>
pub fn sources(&self) -> impl Iterator<Item = &Source>
The style’s sources, in the order they were added.
Sourcepub fn load_style_json(&mut self, json: &str)
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.
Sourcepub fn load_style_url(&mut self, url: &str)
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.
Sourcepub fn style_url(&self) -> Option<&str>
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.
Sourcepub fn set_fallback_font_faces(&mut self, json: &str) -> Result<(), Error>
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.
Sourcepub fn set_fallback_font_face_list(&mut self, faces: FontFaces)
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.
Sourcepub fn last_style_error(&self) -> Option<&Error>
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.
pub fn cancel_transitions(&mut self)
Sourcepub fn cancel_transitions_with_id(&mut self, transition_id: u64)
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.
Sourcepub fn apply_camera_delta(
&mut self,
delta: &CameraDelta,
) -> Result<CameraCommandId, CameraError>
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.
Sourcepub fn update_camera(&mut self, update: &CameraUpdate) -> CameraCommandId
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.
Sourcepub fn close_camera(&mut self)
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.
Sourcepub fn set_globe_free_bearing(&mut self, free_bearing: bool)
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.
Sourcepub fn set_frame_time(&mut self, time: Option<Instant>)
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.
Sourcepub fn frame_clock(&self) -> FrameClock
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.
Sourcepub fn sample_frame(&mut self)
pub fn sample_frame(&mut self)
Updates the map for a frame at the frame clock’s time, if an animation runs.
Sourcepub fn lat_lng_bounds_for_camera(
&self,
camera: &CameraOptions,
) -> Result<LatLngBounds, Error>
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.
Sourcepub fn move_by(
&mut self,
point: &ScreenCoordinate,
animation: &AnimationOptions,
) -> Result<(), Error>
pub fn move_by( &mut self, point: &ScreenCoordinate, animation: &AnimationOptions, ) -> Result<(), Error>
Fails with ErrorKind::InvalidArgument for a NaN or infinite
point.
Sourcepub fn camera_for_lat_lng_bounds(
&self,
bounds: &LatLngBounds,
padding: &EdgeInsets,
bearing: Option<f64>,
pitch: Option<f64>,
) -> Result<CameraOptions, Error>
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).
Sourcepub fn camera_for_lat_lngs(
&self,
lat_lngs: &[LatLng],
padding: &EdgeInsets,
bearing: Option<f64>,
pitch: Option<f64>,
) -> Result<CameraOptions, Error>
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.
Sourcepub fn camera_for_geometry(
&self,
geometry: &Geometry<f64>,
padding: &EdgeInsets,
bearing: Option<f64>,
pitch: Option<f64>,
) -> Result<CameraOptions, Error>
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°).
Sourcepub fn lat_lng_bounds_for_camera_unwrapped(
&self,
camera: &CameraOptions,
) -> Result<LatLngBounds, Error>
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.
pub fn set_bounds(&mut self, options: &BoundOptions) -> Result<(), Error>
Sourcepub fn set_viewport(&mut self, viewport: &Viewport)
pub fn set_viewport(&mut self, viewport: &Viewport)
Sets how the map orients and constrains its view, every setting at once.
Sourcepub fn set_size(&mut self, size: Size) -> Result<(), Error>
pub fn set_size(&mut self, size: Size) -> Result<(), Error>
Fails with ErrorKind::InvalidArgument for an empty size.
Sourcepub fn set_pixel_ratio(&mut self, pixel_ratio: f32) -> Result<(), Error>
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.
pub fn set_projection_mode(&mut self, options: &ProjectionMode)
Sourcepub fn transform_state(&self) -> &TransformState
pub fn transform_state(&self) -> &TransformState
The camera, the viewport and the limits the camera moves within.
Sourcepub fn set_tile_settings(&mut self, tile: &TileSettings)
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.
Sourcepub fn pixel_for_lat_lng(&self, lat_lng: &LatLng) -> ScreenCoordinate
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.
Sourcepub fn lat_lng_for_pixel(
&self,
pixel: &ScreenCoordinate,
wrap_mode: WrapMode,
) -> Result<LatLng, Error>
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.
Sourcepub fn lat_lngs_for_pixels(
&self,
screen_coords: &[ScreenCoordinate],
wrap_mode: WrapMode,
) -> Result<Vec<LatLng>, Error>
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.
Sourcepub fn set_free_camera_options(&mut self, camera: &FreeCameraOptions)
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.
Sourcepub fn set_center_clamped_to_ground(&mut self, clamped: bool)
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.
Sourcepub fn center_clamped_to_ground(&self) -> bool
pub fn center_clamped_to_ground(&self) -> bool
Whether the center stands on the terrain.
Sourcepub fn ground(&self) -> Option<Arc<dyn Elevation>>
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.
Sourcepub fn generation(&self) -> u64
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.
Sourcepub fn update_generation(&self) -> u64
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.
Sourcepub fn pending_update_generation(&self) -> u64
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.
Sourcepub fn snapshot(&self) -> MapSnapshot
pub fn snapshot(&self) -> MapSnapshot
Copies the map’s state.
Sourcepub fn dump_debug_logs(&self)
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> 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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.