Function abstio::maybe_read_binary
source · pub fn maybe_read_binary<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
diff --git a/rustdoc/abstio/abst_paths/struct.MapName.html b/rustdoc/abstio/abst_paths/struct.MapName.html
index bd7c4171da..353954c4e4 100644
--- a/rustdoc/abstio/abst_paths/struct.MapName.html
+++ b/rustdoc/abstio/abst_paths/struct.MapName.html
@@ -34,11 +34,11 @@ by ==
.impl PartialOrd for MapName
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl CloneableAny for MapName
impl Eq for MapName
impl StructuralEq for MapName
impl StructuralPartialEq for MapName
key
and return true
if they are equal.Span
], returning an
diff --git a/rustdoc/abstio/fn.maybe_read_binary.html b/rustdoc/abstio/fn.maybe_read_binary.html
index 5aabe14012..803c873bb5 100644
--- a/rustdoc/abstio/fn.maybe_read_binary.html
+++ b/rustdoc/abstio/fn.maybe_read_binary.html
@@ -1,4 +1,4 @@
pub fn maybe_read_binary<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
pub fn maybe_read_json<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
pub fn must_read_object<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> T
May be a JSON or binary file. Panics on failure.
pub fn read_binary<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> T
pub fn read_json<T: DeserializeOwned>(path: String, timer: &mut Timer<'_>) -> T
pub fn read_object<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
May be a JSON or binary file
pub fn maybe_read_json<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
pub fn must_read_object<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> T
May be a JSON or binary file. Panics on failure.
pub fn read_binary<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> T
pub fn read_object<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
May be a JSON or binary file
pub fn maybe_read_binary<T: DeserializeOwned>(
path: String,
- timer: &mut Timer<'_>
+ timer: &mut Timer<'_>
) -> Result<T>
inner: BufReader<File>
§path: String
§processed_bytes: usize
§total_bytes: usize
§started_at: Instant
§last_printed_at: Instant
Also hands back a callback that’ll add the final result to the timer. The caller must run +) -> Result<(FileWithProgress, Box<dyn Fn(&mut Timer<'_>)>)>
Also hands back a callback that’ll add the final result to the timer. The caller must run it.
read
, except that it reads into a slice of buffers. Read morecan_vector
)Read
er has an efficient read_vectored
diff --git a/rustdoc/abstio/struct.FileWithProgress.html b/rustdoc/abstio/struct.FileWithProgress.html
index 4db891379a..716d7f9b33 100644
--- a/rustdoc/abstio/struct.FileWithProgress.html
+++ b/rustdoc/abstio/struct.FileWithProgress.html
@@ -7,7 +7,7 @@
last_printed_at: Instant,
}inner: BufReader<File>
§path: String
§processed_bytes: usize
§total_bytes: usize
§started_at: Instant
§last_printed_at: Instant
Also hands back a callback that’ll add the final result to the timer. The caller must run +) -> Result<(FileWithProgress, Box<dyn Fn(&mut Timer<'_>)>)>
Also hands back a callback that’ll add the final result to the timer. The caller must run it.
read
, except that it reads into a slice of buffers. Read morecan_vector
)Read
er has an efficient read_vectored
diff --git a/rustdoc/abstio/struct.MapName.html b/rustdoc/abstio/struct.MapName.html
index 2482286c55..2993828e02 100644
--- a/rustdoc/abstio/struct.MapName.html
+++ b/rustdoc/abstio/struct.MapName.html
@@ -34,11 +34,11 @@ by ==
.self
and other
) and is used by the <=
operator. Read morekey
and return true
if they are equal.Span
], returning an
diff --git a/rustdoc/game/app/fn.add_study_area.html b/rustdoc/game/app/fn.add_study_area.html
index 7398114ffe..97c72841d7 100644
--- a/rustdoc/game/app/fn.add_study_area.html
+++ b/rustdoc/game/app/fn.add_study_area.html
@@ -1,2 +1,2 @@
-fn add_study_area(map: &mut Map, name: &str) -> Result<()>
Load an extra GeoJSON file, and add the area to the map dynamically.
+If an intersection was clicked, return its ID.
-If an intersection was clicked, return its ID.
+widgetry::State
that warps to the given point.pub struct FindDelayedIntersections {
pub halt_limit: Duration,
pub report_limit: Duration,
- pub currently_delayed: Vec<(IntersectionID, Time)>,
-}
halt_limit: Duration
§report_limit: Duration
§currently_delayed: Vec<(IntersectionID, Time)>
halt_limit: Duration
§report_limit: Duration
§currently_delayed: Vec<(IntersectionID, Time)>
pub struct PerMap {Show 16 fields
- pub map: Map,
+ pub map: Map,
pub draw_map: DrawMap,
pub sim: Sim,
pub agents: RefCell<AgentCache>,
@@ -9,16 +9,16 @@
pub sim_cb: Option<Box<dyn SimCallback>>,
pub dirty_from_edits: bool,
pub has_modified_trips: bool,
- pub unedited_map: Option<Map>,
+ pub unedited_map: Option<Map>,
pub layer: Option<Box<dyn Layer>>,
pub suspended_sim: Option<Sim>,
prebaked: Option<(MapName, String, Analytics)>,
pub scenario: Option<Scenario>,
pub is_secondary: bool,
}
All of the state that’s bound to a specific map.
-map: Map
§draw_map: DrawMap
§sim: Sim
§agents: RefCell<AgentCache>
§current_selection: Option<ID>
§current_flags: Flags
§last_warped_from: Option<(Pt2D, f64)>
§sim_cb: Option<Box<dyn SimCallback>>
§dirty_from_edits: bool
If we ever left edit mode and resumed without restarting from midnight, this is true.
+map: Map
§draw_map: DrawMap
§sim: Sim
§agents: RefCell<AgentCache>
§current_selection: Option<ID>
§current_flags: Flags
§last_warped_from: Option<(Pt2D, f64)>
§sim_cb: Option<Box<dyn SimCallback>>
§dirty_from_edits: bool
If we ever left edit mode and resumed without restarting from midnight, this is true.
has_modified_trips: bool
Any ScenarioModifiers in effect?
-unedited_map: Option<Map>
If the map has been edited and app.store_unedited_map_in_secondary
is false, store the
+
unedited_map: Option<Map>
If the map has been edited and app.store_unedited_map_in_secondary
is false, store the
unedited map here.
layer: Option<Box<dyn Layer>>
§suspended_sim: Option<Sim>
Only filled out in edit mode. Stored here once to avoid lots of clones. Used for preview.
prebaked: Option<(MapName, String, Analytics)>
Only exists in some gameplay modes. Must be carefully reset otherwise. Has the map and @@ -29,7 +29,7 @@ gameplay mode; always verify the name matches what’s needed.
loading it again from a file. This is particularly painful on the web!is_secondary: bool
Is this the original “secondary” state, loaded via –diff?
enum Mode {
Neutral,
- Hovering(IntersectionID),
+ Hovering(IntersectionID),
Dragging {
idx: usize,
- at: IntersectionID,
+ at: IntersectionID,
},
-}
self
and other
values to be equal, and is used
+}struct Route {
- waypoints: Vec<IntersectionID>,
- full_path: Vec<IntersectionID>,
-}
waypoints: Vec<IntersectionID>
§full_path: Vec<IntersectionID>
waypoints: Vec<IntersectionID>
§full_path: Vec<IntersectionID>
pub struct RouteSketcher {
- snap_to_intersections: FindClosest<IntersectionID>,
+ snap_to_intersections: FindClosest<IntersectionID>,
route: Route,
mode: Mode,
preview: DrawUnzoomedShapes,
-}
snap_to_intersections: FindClosest<IntersectionID>
§route: Route
§mode: Mode
§preview: DrawUnzoomedShapes
True if the route changed
+}snap_to_intersections: FindClosest<IntersectionID>
§route: Route
§mode: Mode
§preview: DrawUnzoomedShapes
True if the route changed
True if something changed. False if this component doesn’t even handle that kind of click.
-Has the user even picked a start point?
+Has the user even picked a start point?
Has the user specified a full route?
pub enum Mode {
Pan,
Route {
- i1: Option<IntersectionID>,
- preview_path: Option<(IntersectionID, Vec<RoadID>, Drawable)>,
+ i1: Option<IntersectionID>,
+ preview_path: Option<(IntersectionID, Vec<RoadID>, Drawable)>,
},
Paint,
Erase,
}
No selecting, just normal click-and-drag controls.
-The user is choosing two intersections, to select the route between.
+The user is choosing two intersections, to select the route between.
Click and drag to select roads
Click and drag to unselect roads
pub struct RoadSelector {
- pub roads: BTreeSet<RoadID>,
- pub intersections: BTreeSet<IntersectionID>,
+ pub roads: BTreeSet<RoadID>,
+ pub intersections: BTreeSet<IntersectionID>,
pub preview: Option<Drawable>,
mode: Mode,
dragging: bool,
}
A tool for selecting multiple roads.
-roads: BTreeSet<RoadID>
§intersections: BTreeSet<IntersectionID>
Intersections can’t be selected directly. If all roads connected to an intersection are +
roads: BTreeSet<RoadID>
§intersections: BTreeSet<IntersectionID>
Intersections can’t be selected directly. If all roads connected to an intersection are selected, then the intersection will be too.
preview: Option<Drawable>
§mode: Mode
§dragging: bool
enum Source {
- Floodfill(LaneID),
+ Floodfill(LaneID),
Scc,
-}
panel: Panel
§draw: ToggleZoomed
§source: Source
pub struct ObjectDebugger;
pub struct ObjectDebugger;
pub struct PathCounter {
panel: Panel,
draw: ToggleZoomed,
- cnt: Counter<RoadID>,
+ cnt: Counter<RoadID>,
tooltip: Option<Text>,
}
A state to count the number of trips that will cross different roads.
-panel: Panel
§draw: ToggleZoomed
§cnt: Counter<RoadID>
§tooltip: Option<Text>
panel: Panel
§draw: ToggleZoomed
§cnt: Counter<RoadID>
§tooltip: Option<Text>
fn calculate_demand(
app: &App,
- pathfinder: &Pathfinder,
- requests: &[PathRequest],
+ pathfinder: &Pathfinder,
+ requests: &[PathRequest],
timer: &mut Timer<'_>
-) -> Counter<RoadID>
fn controls_to_params(panel: &Panel) -> (TripMode, RoutingParams)
fn params_to_controls(
ctx: &mut EventCtx<'_>,
mode: TripMode,
- params: &RoutingParams
+ params: &RoutingParams
) -> Widget
struct AllRoutesExplorer {
panel: Panel,
- requests: Vec<PathRequest>,
- baseline_counts: Counter<RoadID>,
- current_counts: Counter<RoadID>,
+ requests: Vec<PathRequest>,
+ baseline_counts: Counter<RoadID>,
+ current_counts: Counter<RoadID>,
draw: ToggleZoomed,
tooltip: Option<Text>,
}
See how live-tuned routing parameters affect all requests for the current scenario.
-panel: Panel
§requests: Vec<PathRequest>
§baseline_counts: Counter<RoadID>
§current_counts: Counter<RoadID>
§draw: ToggleZoomed
§tooltip: Option<Text>
Transition::Recreate
by assuming state in the app has changed, but preserving
+panel: Panel
§requests: Vec<PathRequest>
§baseline_counts: Counter<RoadID>
§current_counts: Counter<RoadID>
§draw: ToggleZoomed
§tooltip: Option<Text>
pub struct PathCostDebugger {
draw_path: Drawable,
- costs: HashMap<DirectedRoadID, Duration>,
+ costs: HashMap<DirectedRoadID, Duration>,
tooltip: Option<Text>,
panel: Panel,
}
Evaluate why an alternative path wasn’t chosen, by showing the cost to reach every road from one start.
-draw_path: Drawable
§costs: HashMap<DirectedRoadID, Duration>
§tooltip: Option<Text>
§panel: Panel
draw_path: Drawable
§costs: HashMap<DirectedRoadID, Duration>
§tooltip: Option<Text>
§panel: Panel
panel: Panel
§selector: RoadSelector
panel: Panel
§common: CommonState
§tool_panel: Panel
§objects: ObjectDebugger
§layers: ShowLayers
§search_results: Option<SearchResults>
§all_routes: Option<(usize, Drawable)>
§highlighted_agents: Cached<IntersectionID, Drawable>
Transition::Recreate
by assuming state in the app has changed, but preserving
+ highlighted_agents: Cached<IntersectionID, Drawable>,
+}panel: Panel
§common: CommonState
§tool_panel: Panel
§objects: ObjectDebugger
§layers: ShowLayers
§search_results: Option<SearchResults>
§all_routes: Option<(usize, Drawable)>
§highlighted_agents: Cached<IntersectionID, Drawable>
pub struct UberTurnPicker {
- members: BTreeSet<IntersectionID>,
-}
members: BTreeSet<IntersectionID>
members: BTreeSet<IntersectionID>
struct UberTurnViewer {
draw: Drawable,
- ic: IntersectionCluster,
+ ic: IntersectionCluster,
idx: usize,
legal_turns: bool,
-}
draw: Drawable
§ic: IntersectionCluster
§idx: usize
§legal_turns: bool
draw: Drawable
§ic: IntersectionCluster
§idx: usize
§legal_turns: bool
fn aggregated(
ctx: &mut EventCtx<'_>,
app: &App,
- data: &CollisionDataset,
+ data: &CollisionDataset,
indices: Vec<usize>
) -> World<DummyID>
fn individual(
ctx: &mut EventCtx<'_>,
app: &App,
- data: &CollisionDataset,
+ data: &CollisionDataset,
indices: Vec<usize>
) -> World<DummyID>
pub struct CollisionsViewer {
- data: CollisionDataset,
+ data: CollisionDataset,
world: World<DummyID>,
panel: Panel,
-}
data: CollisionDataset
§world: World<DummyID>
§panel: Panel
Transition::Recreate
by assuming state in the app has changed, but preserving
+}data: CollisionDataset
§world: World<DummyID>
§panel: Panel
struct Filters {
show_individual: bool,
time_range: (Duration, Duration),
- severity: Option<Severity>,
-}
show_individual: bool
§time_range: (Duration, Duration)
§severity: Option<Severity>
Returns the indices of all matching collisions
+ severity: Option<Severity>, +}show_individual: bool
§time_range: (Duration, Duration)
§severity: Option<Severity>
pub struct PopularDestinations {
- per_bldg: Counter<BuildingID>,
+ per_bldg: Counter<BuildingID>,
panel: Panel,
draw: Drawable,
-}
per_bldg: Counter<BuildingID>
§panel: Panel
§draw: Drawable