diff --git a/cu29/all.html b/cu29/all.html index e9531abb6..7ca2d58f6 100644 --- a/cu29/all.html +++ b/cu29/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Functions

Type Aliases

Statics

Constants

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Functions

Type Aliases

Statics

Constants

\ No newline at end of file diff --git a/cu29/config/fn.read_configuration.html b/cu29/config/fn.read_configuration.html index 721377cc3..145293a3b 100644 --- a/cu29/config/fn.read_configuration.html +++ b/cu29/config/fn.read_configuration.html @@ -1,2 +1,2 @@ -read_configuration in cu29::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29/config/fn.read_configuration_str.html b/cu29/config/fn.read_configuration_str.html index 30aa10e47..21885d4d9 100644 --- a/cu29/config/fn.read_configuration_str.html +++ b/cu29/config/fn.read_configuration_str.html @@ -1,4 +1,4 @@ -read_configuration_str in cu29::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
+read_configuration_str in cu29::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
     config_content: String,
 ) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a String.

\ No newline at end of file diff --git a/cu29/config/index.html b/cu29/config/index.html index 31eaa7845..83f046be6 100644 --- a/cu29/config/index.html +++ b/cu29/config/index.html @@ -1,4 +1,4 @@ -cu29::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. +cu29::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.

diff --git a/cu29/config/struct.Cnx.html b/cu29/config/struct.Cnx.html index 1bc9ac576..f02c75ce3 100644 --- a/cu29/config/struct.Cnx.html +++ b/cu29/config/struct.Cnx.html @@ -1,4 +1,4 @@ -Cnx in cu29::config - Rust

Struct Cnx

Source
pub struct Cnx {
+Cnx in cu29::config - Rust

Struct Cnx

Source
pub struct Cnx {
     pub msg: String,
     pub batch: Option<u32>,
     pub store: Option<bool>,
diff --git a/cu29/config/struct.ComponentConfig.html b/cu29/config/struct.ComponentConfig.html
index 9dd3af040..deda71662 100644
--- a/cu29/config/struct.ComponentConfig.html
+++ b/cu29/config/struct.ComponentConfig.html
@@ -1,4 +1,4 @@
-ComponentConfig in cu29::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w +ComponentConfig in cu29::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.

Tuple Fields§

§0: HashMap<String, Value>

Implementations§

Source§

impl ComponentConfig

Source

pub fn new() -> ComponentConfig

Source

pub fn get<T>(&self, key: &str) -> Option<T>
where diff --git a/cu29/config/struct.CuConfig.html b/cu29/config/struct.CuConfig.html index d43054118..854873365 100644 --- a/cu29/config/struct.CuConfig.html +++ b/cu29/config/struct.CuConfig.html @@ -1,4 +1,4 @@ -CuConfig in cu29::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
+CuConfig in cu29::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
     pub graph: StableGraph<Node, Cnx>,
     pub monitor: Option<MonitorConfig>,
     pub logging: Option<LoggingConfig>,
diff --git a/cu29/config/struct.LoggingConfig.html b/cu29/config/struct.LoggingConfig.html
index 71492fc3a..4dfbdea7c 100644
--- a/cu29/config/struct.LoggingConfig.html
+++ b/cu29/config/struct.LoggingConfig.html
@@ -1,4 +1,4 @@
-LoggingConfig in cu29::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
+LoggingConfig in cu29::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
     pub slab_size_mib: Option<u64>,
     pub section_size_mib: Option<u64>,
     pub enable_task_logging: bool,
diff --git a/cu29/config/struct.MonitorConfig.html b/cu29/config/struct.MonitorConfig.html
index febd6c47c..2993564e1 100644
--- a/cu29/config/struct.MonitorConfig.html
+++ b/cu29/config/struct.MonitorConfig.html
@@ -1,4 +1,4 @@
-MonitorConfig in cu29::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( +MonitorConfig in cu29::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MonitorConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MonitorConfig

Source§

fn serialize<__S>( diff --git a/cu29/config/struct.Node.html b/cu29/config/struct.Node.html index d1cd46cdd..e391b3d26 100644 --- a/cu29/config/struct.Node.html +++ b/cu29/config/struct.Node.html @@ -1,4 +1,4 @@ -Node in cu29::config - Rust

Struct Node

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

A node in the configuration graph. +Node in cu29::config - Rust

Struct Node

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

A node in the configuration graph. A node represents a Task in the system Graph.

Implementations§

Source§

impl Node

Source

pub fn new(id: &str, ptype: &str) -> Node

Source

pub fn get_id(&self) -> String

Source

pub fn set_type(self, name: Option<String>) -> Node

Source

pub fn get_type(&self) -> &str

Source

pub fn get_instance_config(&self) -> Option<&ComponentConfig>

Source

pub fn get_param<T>(&self, key: &str) -> Option<T>
where T: From<Value>,

Source

pub fn set_param<T>(&mut self, key: &str, value: T)
where diff --git a/cu29/config/struct.Value.html b/cu29/config/struct.Value.html index 8638dbd06..b82cd8315 100644 --- a/cu29/config/struct.Value.html +++ b/cu29/config/struct.Value.html @@ -1,4 +1,4 @@ -Value in cu29::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

+Value in cu29::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 Debug for Value

Source§

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

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

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Value, <__D as Deserializer<'de>>::Error>
where diff --git a/cu29/config/type.NodeId.html b/cu29/config/type.NodeId.html index 44b652111..fbeb2efc7 100644 --- a/cu29/config/type.NodeId.html +++ b/cu29/config/type.NodeId.html @@ -1,3 +1,3 @@ -NodeId in cu29::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph +NodeId in cu29::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph and the code generation.

\ No newline at end of file diff --git a/cu29/copperlist/enum.CopperListState.html b/cu29/copperlist/enum.CopperListState.html index e4134e799..033a71c88 100644 --- a/cu29/copperlist/enum.CopperListState.html +++ b/cu29/copperlist/enum.CopperListState.html @@ -1,4 +1,4 @@ -CopperListState in cu29::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
+CopperListState in cu29::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
     Free,
     Initialized,
     Processing,
diff --git a/cu29/copperlist/index.html b/cu29/copperlist/index.html
index 848062b4e..f4e66eb2b 100644
--- a/cu29/copperlist/index.html
+++ b/cu29/copperlist/index.html
@@ -1,4 +1,4 @@
-cu29::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. +cu29::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. It is a queue that can be used to store preallocated messages between tasks in memory order.

Structs§

CopperLiskMask
Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.
CopperList
CuListsManager
This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. diff --git a/cu29/copperlist/struct.CopperLiskMask.html b/cu29/copperlist/struct.CopperLiskMask.html index 339ba342b..95e2c4270 100644 --- a/cu29/copperlist/struct.CopperLiskMask.html +++ b/cu29/copperlist/struct.CopperLiskMask.html @@ -1,4 +1,4 @@ -CopperLiskMask in cu29::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. +CopperLiskMask in cu29::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for CopperLiskMask

Source§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CopperLiskMask

Source§

fn clone(&self) -> CopperLiskMask

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 Debug for CopperLiskMask

Source§

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

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

impl Decode for CopperLiskMask

Source§

fn decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where diff --git a/cu29/copperlist/struct.CopperList.html b/cu29/copperlist/struct.CopperList.html index f5eef0984..e57e438c9 100644 --- a/cu29/copperlist/struct.CopperList.html +++ b/cu29/copperlist/struct.CopperList.html @@ -1,4 +1,4 @@ -CopperList in cu29::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P>
where +CopperList in cu29::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P>
where P: CopperListTuple,
{ pub id: u32, pub msgs: P, diff --git a/cu29/copperlist/struct.CuListsManager.html b/cu29/copperlist/struct.CuListsManager.html index 966f36eea..e37d6b3fd 100644 --- a/cu29/copperlist/struct.CuListsManager.html +++ b/cu29/copperlist/struct.CuListsManager.html @@ -1,4 +1,4 @@ -CuListsManager in cu29::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where +CuListsManager in cu29::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where P: CopperListTuple,
{ /* private fields */ }
Expand description

This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.

diff --git a/cu29/copperlist/type.AscIter.html b/cu29/copperlist/type.AscIter.html index 43345655e..8313bb960 100644 --- a/cu29/copperlist/type.AscIter.html +++ b/cu29/copperlist/type.AscIter.html @@ -1 +1 @@ -AscIter in cu29::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file +AscIter in cu29::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/copperlist/type.AscIterMut.html b/cu29/copperlist/type.AscIterMut.html index 3abe6f215..4f47f502c 100644 --- a/cu29/copperlist/type.AscIterMut.html +++ b/cu29/copperlist/type.AscIterMut.html @@ -1 +1 @@ -AscIterMut in cu29::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file +AscIterMut in cu29::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/copperlist/type.Iter.html b/cu29/copperlist/type.Iter.html index bdd06367c..81fefe4a4 100644 --- a/cu29/copperlist/type.Iter.html +++ b/cu29/copperlist/type.Iter.html @@ -1 +1 @@ -Iter in cu29::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file +Iter in cu29::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/copperlist/type.IterMut.html b/cu29/copperlist/type.IterMut.html index 5015908e6..50f2fc0e3 100644 --- a/cu29/copperlist/type.IterMut.html +++ b/cu29/copperlist/type.IterMut.html @@ -1 +1 @@ -IterMut in cu29::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file +IterMut in cu29::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/curuntime/enum.CuExecutionUnit.html b/cu29/curuntime/enum.CuExecutionUnit.html index cfa3ebbc4..221857d86 100644 --- a/cu29/curuntime/enum.CuExecutionUnit.html +++ b/cu29/curuntime/enum.CuExecutionUnit.html @@ -1,4 +1,4 @@ -CuExecutionUnit in cu29::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
+CuExecutionUnit in cu29::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
     Step(CuExecutionStep),
     Loop(CuExecutionLoop),
 }
Expand description

This structure represents a step in the execution plan.

diff --git a/cu29/curuntime/enum.CuTaskType.html b/cu29/curuntime/enum.CuTaskType.html index 31cac4473..334bb394f 100644 --- a/cu29/curuntime/enum.CuTaskType.html +++ b/cu29/curuntime/enum.CuTaskType.html @@ -1,4 +1,4 @@ -CuTaskType in cu29::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
+CuTaskType in cu29::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
     Source,
     Regular,
     Sink,
diff --git a/cu29/curuntime/fn.compute_runtime_plan.html b/cu29/curuntime/fn.compute_runtime_plan.html
index 3c3640f03..e595a6f2d 100644
--- a/cu29/curuntime/fn.compute_runtime_plan.html
+++ b/cu29/curuntime/fn.compute_runtime_plan.html
@@ -1,4 +1,4 @@
-compute_runtime_plan in cu29::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
+compute_runtime_plan in cu29::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
     config: &CuConfig,
 ) -> Result<CuExecutionLoop, CuError>
Expand description

This is the main heuristics to compute an execution plan at compilation time. TODO: Make that heuristic pluggable.

diff --git a/cu29/curuntime/fn.find_task_type_for_id.html b/cu29/curuntime/fn.find_task_type_for_id.html index 64446ef60..0bcf3467e 100644 --- a/cu29/curuntime/fn.find_task_type_for_id.html +++ b/cu29/curuntime/fn.find_task_type_for_id.html @@ -1,4 +1,4 @@ -find_task_type_for_id in cu29::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
+find_task_type_for_id in cu29::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
     graph: &StableGraph<Node, Cnx>,
     node_id: u32,
 ) -> CuTaskType
\ No newline at end of file diff --git a/cu29/curuntime/index.html b/cu29/curuntime/index.html index ba8df7915..de1e459a9 100644 --- a/cu29/curuntime/index.html +++ b/cu29/curuntime/index.html @@ -1,4 +1,4 @@ -cu29::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. +cu29::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. It is exposed to the user via the copper_runtime macro injecting it as a field in their application struct.

Structs§

CopperContext
Just a simple struct to hold the various bits needed to run a Copper application.
CuExecutionLoop
This structure represents a loop in the execution plan. It is used to represent a sequence of Execution units (loop or steps) that are executed diff --git a/cu29/curuntime/struct.CopperContext.html b/cu29/curuntime/struct.CopperContext.html index 981e28d64..f12fd74c7 100644 --- a/cu29/curuntime/struct.CopperContext.html +++ b/cu29/curuntime/struct.CopperContext.html @@ -1,4 +1,4 @@ -CopperContext in cu29::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
+CopperContext in cu29::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
     pub unified_logger: Arc<Mutex<UnifiedLoggerWrite>>,
     pub logger_runtime: LoggerRuntime,
     pub clock: RobotClock,
diff --git a/cu29/curuntime/struct.CuExecutionLoop.html b/cu29/curuntime/struct.CuExecutionLoop.html
index 63da153d3..33c9364b6 100644
--- a/cu29/curuntime/struct.CuExecutionLoop.html
+++ b/cu29/curuntime/struct.CuExecutionLoop.html
@@ -1,4 +1,4 @@
-CuExecutionLoop in cu29::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
+CuExecutionLoop in cu29::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
     pub steps: Vec<CuExecutionUnit>,
     pub loop_count: Option<u32>,
 }
Expand description

This structure represents a loop in the execution plan. diff --git a/cu29/curuntime/struct.CuExecutionStep.html b/cu29/curuntime/struct.CuExecutionStep.html index 81b94a74a..cddc1eea0 100644 --- a/cu29/curuntime/struct.CuExecutionStep.html +++ b/cu29/curuntime/struct.CuExecutionStep.html @@ -1,4 +1,4 @@ -CuExecutionStep in cu29::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
+CuExecutionStep in cu29::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
     pub node_id: u32,
     pub node: Node,
     pub task_type: CuTaskType,
diff --git a/cu29/curuntime/struct.CuRuntime.html b/cu29/curuntime/struct.CuRuntime.html
index 692b7264a..d81b47e3d 100644
--- a/cu29/curuntime/struct.CuRuntime.html
+++ b/cu29/curuntime/struct.CuRuntime.html
@@ -1,4 +1,4 @@
-CuRuntime in cu29::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>
where +CuRuntime in cu29::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>{
     pub tasks: CT,
diff --git a/cu29/cutask/index.html b/cu29/cutask/index.html
index 7beaeaa39..517c9262d 100644
--- a/cu29/cutask/index.html
+++ b/cu29/cutask/index.html
@@ -1,4 +1,4 @@
-cu29::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement +cu29::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement or interact with to create a Copper task.

Structs§

CuCompactString
CuMsg
CuMsg is the envelope holding the msg payload and the metadata between tasks.
CuMsgMetadata
CuMsgMetadata is a structure that contains metadata common to all CuMsgs.

Traits§

CuMsgPack
CuMsgPayload
CuSinkTask
A Sink Task is a task that only consumes messages. For example drivers for actuators are Sink Tasks.
CuSrcTask
A Src Task is a task that only produces messages. For example drivers for sensors are Src Tasks. They are in push mode from the runtime. diff --git a/cu29/cutask/struct.CuCompactString.html b/cu29/cutask/struct.CuCompactString.html index 42d0f70d4..2c7e61f5c 100644 --- a/cu29/cutask/struct.CuCompactString.html +++ b/cu29/cutask/struct.CuCompactString.html @@ -1,4 +1,4 @@ -CuCompactString in cu29::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where +CuCompactString in cu29::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: BorrowDecoder<'de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CuCompactString

Source§

fn clone(&self) -> CuCompactString

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 Debug for CuCompactString

Source§

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

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

impl Decode for CuCompactString

Source§

fn decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: Decoder,

Attempt to decode this type with the given Decode.
Source§

impl Default for CuCompactString

Source§

fn default() -> CuCompactString

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

impl<'de> Deserialize<'de> for CuCompactString

Source§

fn deserialize<__D>( __deserializer: __D, diff --git a/cu29/cutask/struct.CuMsg.html b/cu29/cutask/struct.CuMsg.html index 7403fc711..543ef7492 100644 --- a/cu29/cutask/struct.CuMsg.html +++ b/cu29/cutask/struct.CuMsg.html @@ -1,4 +1,4 @@ -CuMsg in cu29::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where +CuMsg in cu29::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where T: CuMsgPayload,
{ pub metadata: CuMsgMetadata, /* private fields */ diff --git a/cu29/cutask/struct.CuMsgMetadata.html b/cu29/cutask/struct.CuMsgMetadata.html index 8c78d6938..3281b1ca7 100644 --- a/cu29/cutask/struct.CuMsgMetadata.html +++ b/cu29/cutask/struct.CuMsgMetadata.html @@ -1,4 +1,4 @@ -CuMsgMetadata in cu29::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
+CuMsgMetadata in cu29::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
     pub process_time: PartialCuTimeRange,
     pub tov: Tov,
     pub status_txt: CuCompactString,
diff --git a/cu29/cutask/trait.CuMsgPack.html b/cu29/cutask/trait.CuMsgPack.html
index 9c8e12526..a3ec51595 100644
--- a/cu29/cutask/trait.CuMsgPack.html
+++ b/cu29/cutask/trait.CuMsgPack.html
@@ -1,4 +1,4 @@
-CuMsgPack in cu29::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where +CuMsgPack in cu29::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl,

Source§

impl<'cl, T1, T2, T3> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>)
where T1: CuMsgPayload + 'cl, diff --git a/cu29/cutask/trait.CuMsgPayload.html b/cu29/cutask/trait.CuMsgPayload.html index 2ba2e4a8d..9f77c0d9c 100644 --- a/cu29/cutask/trait.CuMsgPayload.html +++ b/cu29/cutask/trait.CuMsgPayload.html @@ -1,4 +1,4 @@ -CuMsgPayload in cu29::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
+CuMsgPayload in cu29::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
     Sized
     + Default
     + Debug
diff --git a/cu29/cutask/trait.CuSinkTask.html b/cu29/cutask/trait.CuSinkTask.html
index 08c3240e0..394db2b59 100644
--- a/cu29/cutask/trait.CuSinkTask.html
+++ b/cu29/cutask/trait.CuSinkTask.html
@@ -1,4 +1,4 @@
-CuSinkTask in cu29::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
+CuSinkTask in cu29::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/cutask/trait.CuSrcTask.html b/cu29/cutask/trait.CuSrcTask.html
index 74a63a373..235bb7f04 100644
--- a/cu29/cutask/trait.CuSrcTask.html
+++ b/cu29/cutask/trait.CuSrcTask.html
@@ -1,4 +1,4 @@
-CuSrcTask in cu29::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
+CuSrcTask in cu29::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
     type Output: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/cutask/trait.CuTask.html b/cu29/cutask/trait.CuTask.html
index b43984a4a..e64823b12 100644
--- a/cu29/cutask/trait.CuTask.html
+++ b/cu29/cutask/trait.CuTask.html
@@ -1,4 +1,4 @@
-CuTask in cu29::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
+CuTask in cu29::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
     type Output: CuMsgPack<'cl>;
 
diff --git a/cu29/cutask/trait.Freezable.html b/cu29/cutask/trait.Freezable.html
index ad45b9268..c7663ac92 100644
--- a/cu29/cutask/trait.Freezable.html
+++ b/cu29/cutask/trait.Freezable.html
@@ -1,4 +1,4 @@
-Freezable in cu29::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
+Freezable in cu29::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
     // Provided methods
     fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
        where E: Encoder { ... }
diff --git a/cu29/enum.UnifiedLogType.html b/cu29/enum.UnifiedLogType.html
index 35cf628e8..71b744e7f 100644
--- a/cu29/enum.UnifiedLogType.html
+++ b/cu29/enum.UnifiedLogType.html
@@ -1,4 +1,4 @@
-UnifiedLogType in cu29 - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
+UnifiedLogType in cu29 - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
     Empty,
     StructuredLogLine,
     CopperList,
diff --git a/cu29/fn.read_configuration.html b/cu29/fn.read_configuration.html
index 1ef3c26cb..57a938141 100644
--- a/cu29/fn.read_configuration.html
+++ b/cu29/fn.read_configuration.html
@@ -1,2 +1,2 @@
-read_configuration in cu29 - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29 - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29/index.html b/cu29/index.html index ffa9d1eb7..289e79710 100644 --- a/cu29/index.html +++ b/cu29/index.html @@ -1,4 +1,4 @@ -cu29 - Rust

Crate cu29

Source
Expand description
logo +cu29 - Rust

Crate cu29

Source
Expand description
logo

§

§Copper

copper GitHub last commit diff --git a/cu29/macro.input_msg.html b/cu29/macro.input_msg.html index 6ba9c4ca4..0faff7b8d 100644 --- a/cu29/macro.input_msg.html +++ b/cu29/macro.input_msg.html @@ -1,4 +1,4 @@ -input_msg in cu29 - Rust

Macro input_msg

Source
macro_rules! input_msg {
+input_msg in cu29 - Rust

Macro input_msg

Source
macro_rules! input_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
     ($lifetime:lifetime, $($ty:ty),*) => { ... };
 }
\ No newline at end of file diff --git a/cu29/macro.output_msg.html b/cu29/macro.output_msg.html index c43f5a434..c3decf8c5 100644 --- a/cu29/macro.output_msg.html +++ b/cu29/macro.output_msg.html @@ -1,3 +1,3 @@ -output_msg in cu29 - Rust

Macro output_msg

Source
macro_rules! output_msg {
+output_msg in cu29 - Rust

Macro output_msg

Source
macro_rules! output_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
 }
\ No newline at end of file diff --git a/cu29/monitoring/enum.CuTaskState.html b/cu29/monitoring/enum.CuTaskState.html index 60808435e..f3e524222 100644 --- a/cu29/monitoring/enum.CuTaskState.html +++ b/cu29/monitoring/enum.CuTaskState.html @@ -1,4 +1,4 @@ -CuTaskState in cu29::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
+CuTaskState in cu29::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
     Start,
     Preprocess,
     Process,
diff --git a/cu29/monitoring/enum.Decision.html b/cu29/monitoring/enum.Decision.html
index b08f8f9a7..4883b05ca 100644
--- a/cu29/monitoring/enum.Decision.html
+++ b/cu29/monitoring/enum.Decision.html
@@ -1,4 +1,4 @@
-Decision in cu29::monitoring - Rust

Enum Decision

Source
pub enum Decision {
+Decision in cu29::monitoring - Rust

Enum Decision

Source
pub enum Decision {
     Abort,
     Ignore,
     Shutdown,
diff --git a/cu29/monitoring/index.html b/cu29/monitoring/index.html
index 366d8201d..3c0e45f87 100644
--- a/cu29/monitoring/index.html
+++ b/cu29/monitoring/index.html
@@ -1,4 +1,4 @@
-cu29::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

+cu29::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

Structs§

CountingAllocator
A simple allocator that counts the number of bytes allocated and deallocated.
CuDurationStatistics
A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.
LiveStatistics
Accumulative stat object that can give your some real time statistics.
NoMonitor
A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.
ScopedAllocCounter
A simple struct that counts the number of bytes allocated and deallocated in a scope.

Enums§

CuTaskState
The state of a task.
Decision
Monitor decision to be taken when a task errored out.

Statics§

GLOBAL

Traits§

CuMonitor
Trait to implement a monitoring task.
\ No newline at end of file diff --git a/cu29/monitoring/static.GLOBAL.html b/cu29/monitoring/static.GLOBAL.html index e71a9a008..e68b99e3f 100644 --- a/cu29/monitoring/static.GLOBAL.html +++ b/cu29/monitoring/static.GLOBAL.html @@ -1 +1 @@ -GLOBAL in cu29::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file +GLOBAL in cu29::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file diff --git a/cu29/monitoring/struct.CountingAllocator.html b/cu29/monitoring/struct.CountingAllocator.html index 2ef3ff141..2ce89374a 100644 --- a/cu29/monitoring/struct.CountingAllocator.html +++ b/cu29/monitoring/struct.CountingAllocator.html @@ -1,4 +1,4 @@ -CountingAllocator in cu29::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

+CountingAllocator in cu29::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

Implementations§

Trait Implementations§

Source§

impl Default for CountingAllocator

Source§

fn default() -> CountingAllocator

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

impl GlobalAlloc for CountingAllocator

Source§

unsafe fn alloc(&self, layout: Layout) -> *mut u8

Allocates memory as described by the given layout. Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)

Deallocates the block of memory at the given ptr pointer with the given layout. Read more
1.28.0 · Source§

unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more
1.28.0 · Source§

unsafe fn realloc( &self, diff --git a/cu29/monitoring/struct.CuDurationStatistics.html b/cu29/monitoring/struct.CuDurationStatistics.html index d06fddda7..82839d889 100644 --- a/cu29/monitoring/struct.CuDurationStatistics.html +++ b/cu29/monitoring/struct.CuDurationStatistics.html @@ -1,4 +1,4 @@ -CuDurationStatistics in cu29::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. +CuDurationStatistics in cu29::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.

Implementations§

Source§

impl CuDurationStatistics

Source

pub fn new(max: CuDuration) -> CuDurationStatistics

Source

pub fn min(&self) -> CuDuration

Source

pub fn max(&self) -> CuDuration

Source

pub fn mean(&self) -> CuDuration

Source

pub fn percentile(&self, percentile: f64) -> CuDuration

Source

pub fn stddev(&self) -> CuDuration

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn jitter_min(&self) -> CuDuration

Source

pub fn jitter_max(&self) -> CuDuration

Source

pub fn jitter_mean(&self) -> CuDuration

Source

pub fn jitter_stddev(&self) -> CuDuration

Source

pub fn jitter_percentile(&self, percentile: f64) -> CuDuration

Source

pub fn record(&mut self, value: CuDuration)

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for CuDurationStatistics

Source§

fn clone(&self) -> CuDurationStatistics

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 Debug for CuDurationStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/monitoring/struct.LiveStatistics.html b/cu29/monitoring/struct.LiveStatistics.html index c4421f526..aee0077d1 100644 --- a/cu29/monitoring/struct.LiveStatistics.html +++ b/cu29/monitoring/struct.LiveStatistics.html @@ -1,4 +1,4 @@ -LiveStatistics in cu29::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

+LiveStatistics in cu29::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

Implementations§

Source§

impl LiveStatistics

Source

pub fn new_unbounded() -> LiveStatistics

Source

pub fn new_with_max(max: u64) -> LiveStatistics

Source

pub fn min(&self) -> u64

Source

pub fn max(&self) -> u64

Source

pub fn mean(&self) -> f64

Source

pub fn percentile(&self, percentile: f64) -> u64

Source

pub fn record(&mut self, value: u64)

Adds a value to the statistics.

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for LiveStatistics

Source§

fn clone(&self) -> LiveStatistics

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 Debug for LiveStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/monitoring/struct.NoMonitor.html b/cu29/monitoring/struct.NoMonitor.html index 0694a1b96..3ae682f39 100644 --- a/cu29/monitoring/struct.NoMonitor.html +++ b/cu29/monitoring/struct.NoMonitor.html @@ -1,4 +1,4 @@ -NoMonitor in cu29::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. +NoMonitor in cu29::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.

Trait Implementations§

Source§

impl CuMonitor for NoMonitor

Source§

fn new( _config: &CuConfig, diff --git a/cu29/monitoring/struct.ScopedAllocCounter.html b/cu29/monitoring/struct.ScopedAllocCounter.html index b56b6b41f..6d543af6d 100644 --- a/cu29/monitoring/struct.ScopedAllocCounter.html +++ b/cu29/monitoring/struct.ScopedAllocCounter.html @@ -1,4 +1,4 @@ -ScopedAllocCounter in cu29::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

+ScopedAllocCounter in cu29::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

Implementations§

Source§

impl ScopedAllocCounter

Source

pub fn new() -> ScopedAllocCounter

Source

pub fn get_allocated(&self) -> usize

Returns the total number of bytes allocated in the current scope since the creation of this ScopedAllocCounter.

§Example
diff --git a/cu29/monitoring/trait.CuMonitor.html b/cu29/monitoring/trait.CuMonitor.html index 41938ce73..309be3a3c 100644 --- a/cu29/monitoring/trait.CuMonitor.html +++ b/cu29/monitoring/trait.CuMonitor.html @@ -1,4 +1,4 @@ -CuMonitor in cu29::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
+CuMonitor in cu29::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
     // Required methods
     fn new(
         config: &CuConfig,
diff --git a/cu29/payload/index.html b/cu29/payload/index.html
index c2ba87e09..cca27b908 100644
--- a/cu29/payload/index.html
+++ b/cu29/payload/index.html
@@ -1 +1 @@
-cu29::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file +cu29::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file diff --git a/cu29/payload/struct.CuArray.html b/cu29/payload/struct.CuArray.html index cdccefe4b..b84193a60 100644 --- a/cu29/payload/struct.CuArray.html +++ b/cu29/payload/struct.CuArray.html @@ -1,4 +1,4 @@ -CuArray in cu29::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

+CuArray in cu29::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

Implementations§

Source§

impl<T, const N: usize> CuArray<T, N>

Source

pub fn new() -> CuArray<T, N>

Source

pub fn fill_from_iter<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn capacity(&self) -> usize

Trait Implementations§

Source§

impl<T, const N: usize> Clone for CuArray<T, N>
where T: Clone,

Source§

fn clone(&self) -> CuArray<T, N>

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<T, const N: usize> Debug for CuArray<T, N>
where diff --git a/cu29/prelude/attr.copper_runtime.html b/cu29/prelude/attr.copper_runtime.html index 8267f0d69..85bf4fdc1 100644 --- a/cu29/prelude/attr.copper_runtime.html +++ b/cu29/prelude/attr.copper_runtime.html @@ -1,4 +1,4 @@ -copper_runtime in cu29::prelude - Rust

Attribute Macro copper_runtime

Source
#[copper_runtime]
Expand description

Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. +copper_runtime in cu29::prelude - Rust

Attribute Macro copper_runtime

Source
#[copper_runtime]
Expand description

Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. if sim_mode is omitted, it is set to false. This will add a “runtime” field to your struct and implement the “new” and “run” methods.

\ No newline at end of file diff --git a/cu29/prelude/config/fn.read_configuration.html b/cu29/prelude/config/fn.read_configuration.html index 18200a494..4a85538c3 100644 --- a/cu29/prelude/config/fn.read_configuration.html +++ b/cu29/prelude/config/fn.read_configuration.html @@ -1,2 +1,2 @@ -read_configuration in cu29::prelude::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29::prelude::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29/prelude/config/fn.read_configuration_str.html b/cu29/prelude/config/fn.read_configuration_str.html index 5c5002c71..2b96d2bea 100644 --- a/cu29/prelude/config/fn.read_configuration_str.html +++ b/cu29/prelude/config/fn.read_configuration_str.html @@ -1,4 +1,4 @@ -read_configuration_str in cu29::prelude::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
+read_configuration_str in cu29::prelude::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
     config_content: String,
 ) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a String.

\ No newline at end of file diff --git a/cu29/prelude/config/index.html b/cu29/prelude/config/index.html index 743c625b9..ef0f7da4d 100644 --- a/cu29/prelude/config/index.html +++ b/cu29/prelude/config/index.html @@ -1,4 +1,4 @@ -cu29::prelude::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. +cu29::prelude::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.

diff --git a/cu29/prelude/config/struct.Cnx.html b/cu29/prelude/config/struct.Cnx.html index bdcefdbdd..ed44f6755 100644 --- a/cu29/prelude/config/struct.Cnx.html +++ b/cu29/prelude/config/struct.Cnx.html @@ -1,4 +1,4 @@ -Cnx in cu29::prelude::config - Rust

Struct Cnx

Source
pub struct Cnx {
+Cnx in cu29::prelude::config - Rust

Struct Cnx

Source
pub struct Cnx {
     pub msg: String,
     pub batch: Option<u32>,
     pub store: Option<bool>,
diff --git a/cu29/prelude/config/struct.ComponentConfig.html b/cu29/prelude/config/struct.ComponentConfig.html
index 8313c0215..e4aa28d29 100644
--- a/cu29/prelude/config/struct.ComponentConfig.html
+++ b/cu29/prelude/config/struct.ComponentConfig.html
@@ -1,4 +1,4 @@
-ComponentConfig in cu29::prelude::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w +ComponentConfig in cu29::prelude::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.

Tuple Fields§

§0: HashMap<String, Value>

Implementations§

Source§

impl ComponentConfig

Source

pub fn new() -> ComponentConfig

Source

pub fn get<T>(&self, key: &str) -> Option<T>
where diff --git a/cu29/prelude/config/struct.CuConfig.html b/cu29/prelude/config/struct.CuConfig.html index f80e4597d..2fc2bc147 100644 --- a/cu29/prelude/config/struct.CuConfig.html +++ b/cu29/prelude/config/struct.CuConfig.html @@ -1,4 +1,4 @@ -CuConfig in cu29::prelude::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
+CuConfig in cu29::prelude::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
     pub graph: StableGraph<Node, Cnx>,
     pub monitor: Option<MonitorConfig>,
     pub logging: Option<LoggingConfig>,
diff --git a/cu29/prelude/config/struct.LoggingConfig.html b/cu29/prelude/config/struct.LoggingConfig.html
index 2fe8a73ce..34dce13e1 100644
--- a/cu29/prelude/config/struct.LoggingConfig.html
+++ b/cu29/prelude/config/struct.LoggingConfig.html
@@ -1,4 +1,4 @@
-LoggingConfig in cu29::prelude::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
+LoggingConfig in cu29::prelude::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
     pub slab_size_mib: Option<u64>,
     pub section_size_mib: Option<u64>,
     pub enable_task_logging: bool,
diff --git a/cu29/prelude/config/struct.MonitorConfig.html b/cu29/prelude/config/struct.MonitorConfig.html
index fe6332191..97a9adf04 100644
--- a/cu29/prelude/config/struct.MonitorConfig.html
+++ b/cu29/prelude/config/struct.MonitorConfig.html
@@ -1,4 +1,4 @@
-MonitorConfig in cu29::prelude::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( +MonitorConfig in cu29::prelude::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MonitorConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MonitorConfig

Source§

fn serialize<__S>( diff --git a/cu29/prelude/config/struct.Node.html b/cu29/prelude/config/struct.Node.html index a8aef5da5..7993788a1 100644 --- a/cu29/prelude/config/struct.Node.html +++ b/cu29/prelude/config/struct.Node.html @@ -1,4 +1,4 @@ -Node in cu29::prelude::config - Rust

Struct Node

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

A node in the configuration graph. +Node in cu29::prelude::config - Rust

Struct Node

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

A node in the configuration graph. A node represents a Task in the system Graph.

Implementations§

Source§

impl Node

Source

pub fn new(id: &str, ptype: &str) -> Node

Source

pub fn get_id(&self) -> String

Source

pub fn set_type(self, name: Option<String>) -> Node

Source

pub fn get_type(&self) -> &str

Source

pub fn get_instance_config(&self) -> Option<&ComponentConfig>

Source

pub fn get_param<T>(&self, key: &str) -> Option<T>
where T: From<Value>,

Source

pub fn set_param<T>(&mut self, key: &str, value: T)
where diff --git a/cu29/prelude/config/struct.Value.html b/cu29/prelude/config/struct.Value.html index fcf8461bb..bc57e2fa9 100644 --- a/cu29/prelude/config/struct.Value.html +++ b/cu29/prelude/config/struct.Value.html @@ -1,4 +1,4 @@ -Value in cu29::prelude::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

+Value in cu29::prelude::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 Debug for Value

Source§

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

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

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Value, <__D as Deserializer<'de>>::Error>
where diff --git a/cu29/prelude/config/type.NodeId.html b/cu29/prelude/config/type.NodeId.html index e7675ba41..5266133c1 100644 --- a/cu29/prelude/config/type.NodeId.html +++ b/cu29/prelude/config/type.NodeId.html @@ -1,3 +1,3 @@ -NodeId in cu29::prelude::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph +NodeId in cu29::prelude::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph and the code generation.

\ No newline at end of file diff --git a/cu29/prelude/constant.ANONYMOUS.html b/cu29/prelude/constant.ANONYMOUS.html index b4de858c4..1d3098819 100644 --- a/cu29/prelude/constant.ANONYMOUS.html +++ b/cu29/prelude/constant.ANONYMOUS.html @@ -1 +1 @@ -ANONYMOUS in cu29::prelude - Rust

Constant ANONYMOUS

pub const ANONYMOUS: u32 = 0; // 0u32
\ No newline at end of file +ANONYMOUS in cu29::prelude - Rust

Constant ANONYMOUS

pub const ANONYMOUS: u32 = 0; // 0u32
\ No newline at end of file diff --git a/cu29/prelude/constant.MAX_LOG_PARAMS_ON_STACK.html b/cu29/prelude/constant.MAX_LOG_PARAMS_ON_STACK.html index fe1d9a580..159d05d35 100644 --- a/cu29/prelude/constant.MAX_LOG_PARAMS_ON_STACK.html +++ b/cu29/prelude/constant.MAX_LOG_PARAMS_ON_STACK.html @@ -1 +1 @@ -MAX_LOG_PARAMS_ON_STACK in cu29::prelude - Rust

Constant MAX_LOG_PARAMS_ON_STACK

pub const MAX_LOG_PARAMS_ON_STACK: usize = 10; // 10usize
\ No newline at end of file +MAX_LOG_PARAMS_ON_STACK in cu29::prelude - Rust

Constant MAX_LOG_PARAMS_ON_STACK

pub const MAX_LOG_PARAMS_ON_STACK: usize = 10; // 10usize
\ No newline at end of file diff --git a/cu29/prelude/copperlist/enum.CopperListState.html b/cu29/prelude/copperlist/enum.CopperListState.html index 58e408b86..11d15d1b6 100644 --- a/cu29/prelude/copperlist/enum.CopperListState.html +++ b/cu29/prelude/copperlist/enum.CopperListState.html @@ -1,4 +1,4 @@ -CopperListState in cu29::prelude::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
+CopperListState in cu29::prelude::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
     Free,
     Initialized,
     Processing,
diff --git a/cu29/prelude/copperlist/index.html b/cu29/prelude/copperlist/index.html
index d7cc5ebc3..79ad9b231 100644
--- a/cu29/prelude/copperlist/index.html
+++ b/cu29/prelude/copperlist/index.html
@@ -1,4 +1,4 @@
-cu29::prelude::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. +cu29::prelude::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. It is a queue that can be used to store preallocated messages between tasks in memory order.

Structs§

CopperLiskMask
Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.
CopperList
CuListsManager
This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. diff --git a/cu29/prelude/copperlist/struct.CopperLiskMask.html b/cu29/prelude/copperlist/struct.CopperLiskMask.html index 207d03a2c..f386163ff 100644 --- a/cu29/prelude/copperlist/struct.CopperLiskMask.html +++ b/cu29/prelude/copperlist/struct.CopperLiskMask.html @@ -1,4 +1,4 @@ -CopperLiskMask in cu29::prelude::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. +CopperLiskMask in cu29::prelude::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for CopperLiskMask

Source§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CopperLiskMask

Source§

fn clone(&self) -> CopperLiskMask

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 Debug for CopperLiskMask

Source§

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

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

impl Decode for CopperLiskMask

Source§

fn decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where diff --git a/cu29/prelude/copperlist/struct.CopperList.html b/cu29/prelude/copperlist/struct.CopperList.html index 07be97c87..505d54a96 100644 --- a/cu29/prelude/copperlist/struct.CopperList.html +++ b/cu29/prelude/copperlist/struct.CopperList.html @@ -1,4 +1,4 @@ -CopperList in cu29::prelude::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P>
where +CopperList in cu29::prelude::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P>
where P: CopperListTuple,
{ pub id: u32, pub msgs: P, diff --git a/cu29/prelude/copperlist/struct.CuListsManager.html b/cu29/prelude/copperlist/struct.CuListsManager.html index 17e83c395..562fbe9cc 100644 --- a/cu29/prelude/copperlist/struct.CuListsManager.html +++ b/cu29/prelude/copperlist/struct.CuListsManager.html @@ -1,4 +1,4 @@ -CuListsManager in cu29::prelude::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where +CuListsManager in cu29::prelude::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where P: CopperListTuple,
{ /* private fields */ }
Expand description

This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.

diff --git a/cu29/prelude/copperlist/type.AscIter.html b/cu29/prelude/copperlist/type.AscIter.html index b15e42394..877bfc7f0 100644 --- a/cu29/prelude/copperlist/type.AscIter.html +++ b/cu29/prelude/copperlist/type.AscIter.html @@ -1 +1 @@ -AscIter in cu29::prelude::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file +AscIter in cu29::prelude::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/copperlist/type.AscIterMut.html b/cu29/prelude/copperlist/type.AscIterMut.html index 0dd41e952..44d6f980f 100644 --- a/cu29/prelude/copperlist/type.AscIterMut.html +++ b/cu29/prelude/copperlist/type.AscIterMut.html @@ -1 +1 @@ -AscIterMut in cu29::prelude::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file +AscIterMut in cu29::prelude::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/copperlist/type.Iter.html b/cu29/prelude/copperlist/type.Iter.html index ade84c5cb..bf00df2d2 100644 --- a/cu29/prelude/copperlist/type.Iter.html +++ b/cu29/prelude/copperlist/type.Iter.html @@ -1 +1 @@ -Iter in cu29::prelude::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file +Iter in cu29::prelude::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/copperlist/type.IterMut.html b/cu29/prelude/copperlist/type.IterMut.html index 1d7139c3b..824f4b021 100644 --- a/cu29/prelude/copperlist/type.IterMut.html +++ b/cu29/prelude/copperlist/type.IterMut.html @@ -1 +1 @@ -IterMut in cu29::prelude::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file +IterMut in cu29::prelude::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/curuntime/enum.CuExecutionUnit.html b/cu29/prelude/curuntime/enum.CuExecutionUnit.html index 279c58992..6ad0d7f83 100644 --- a/cu29/prelude/curuntime/enum.CuExecutionUnit.html +++ b/cu29/prelude/curuntime/enum.CuExecutionUnit.html @@ -1,4 +1,4 @@ -CuExecutionUnit in cu29::prelude::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
+CuExecutionUnit in cu29::prelude::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
     Step(CuExecutionStep),
     Loop(CuExecutionLoop),
 }
Expand description

This structure represents a step in the execution plan.

diff --git a/cu29/prelude/curuntime/enum.CuTaskType.html b/cu29/prelude/curuntime/enum.CuTaskType.html index 255f6ea69..f77a7c168 100644 --- a/cu29/prelude/curuntime/enum.CuTaskType.html +++ b/cu29/prelude/curuntime/enum.CuTaskType.html @@ -1,4 +1,4 @@ -CuTaskType in cu29::prelude::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
+CuTaskType in cu29::prelude::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
     Source,
     Regular,
     Sink,
diff --git a/cu29/prelude/curuntime/fn.compute_runtime_plan.html b/cu29/prelude/curuntime/fn.compute_runtime_plan.html
index a09670181..bd6994fea 100644
--- a/cu29/prelude/curuntime/fn.compute_runtime_plan.html
+++ b/cu29/prelude/curuntime/fn.compute_runtime_plan.html
@@ -1,4 +1,4 @@
-compute_runtime_plan in cu29::prelude::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
+compute_runtime_plan in cu29::prelude::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
     config: &CuConfig,
 ) -> Result<CuExecutionLoop, CuError>
Expand description

This is the main heuristics to compute an execution plan at compilation time. TODO: Make that heuristic pluggable.

diff --git a/cu29/prelude/curuntime/fn.find_task_type_for_id.html b/cu29/prelude/curuntime/fn.find_task_type_for_id.html index 49883a3b5..0ed30c0cd 100644 --- a/cu29/prelude/curuntime/fn.find_task_type_for_id.html +++ b/cu29/prelude/curuntime/fn.find_task_type_for_id.html @@ -1,4 +1,4 @@ -find_task_type_for_id in cu29::prelude::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
+find_task_type_for_id in cu29::prelude::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
     graph: &StableGraph<Node, Cnx>,
     node_id: u32,
 ) -> CuTaskType
\ No newline at end of file diff --git a/cu29/prelude/curuntime/index.html b/cu29/prelude/curuntime/index.html index 7360fb6cd..638c0e8db 100644 --- a/cu29/prelude/curuntime/index.html +++ b/cu29/prelude/curuntime/index.html @@ -1,4 +1,4 @@ -cu29::prelude::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. +cu29::prelude::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. It is exposed to the user via the copper_runtime macro injecting it as a field in their application struct.

Structs§

CopperContext
Just a simple struct to hold the various bits needed to run a Copper application.
CuExecutionLoop
This structure represents a loop in the execution plan. It is used to represent a sequence of Execution units (loop or steps) that are executed diff --git a/cu29/prelude/curuntime/struct.CopperContext.html b/cu29/prelude/curuntime/struct.CopperContext.html index edd386903..ff7278a9b 100644 --- a/cu29/prelude/curuntime/struct.CopperContext.html +++ b/cu29/prelude/curuntime/struct.CopperContext.html @@ -1,4 +1,4 @@ -CopperContext in cu29::prelude::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
+CopperContext in cu29::prelude::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
     pub unified_logger: Arc<Mutex<UnifiedLoggerWrite>>,
     pub logger_runtime: LoggerRuntime,
     pub clock: RobotClock,
diff --git a/cu29/prelude/curuntime/struct.CuExecutionLoop.html b/cu29/prelude/curuntime/struct.CuExecutionLoop.html
index a1c32bf17..2c3b2b708 100644
--- a/cu29/prelude/curuntime/struct.CuExecutionLoop.html
+++ b/cu29/prelude/curuntime/struct.CuExecutionLoop.html
@@ -1,4 +1,4 @@
-CuExecutionLoop in cu29::prelude::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
+CuExecutionLoop in cu29::prelude::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
     pub steps: Vec<CuExecutionUnit>,
     pub loop_count: Option<u32>,
 }
Expand description

This structure represents a loop in the execution plan. diff --git a/cu29/prelude/curuntime/struct.CuExecutionStep.html b/cu29/prelude/curuntime/struct.CuExecutionStep.html index 4647b2fc5..980f2f18b 100644 --- a/cu29/prelude/curuntime/struct.CuExecutionStep.html +++ b/cu29/prelude/curuntime/struct.CuExecutionStep.html @@ -1,4 +1,4 @@ -CuExecutionStep in cu29::prelude::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
+CuExecutionStep in cu29::prelude::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
     pub node_id: u32,
     pub node: Node,
     pub task_type: CuTaskType,
diff --git a/cu29/prelude/curuntime/struct.CuRuntime.html b/cu29/prelude/curuntime/struct.CuRuntime.html
index f96338556..5fb2064bb 100644
--- a/cu29/prelude/curuntime/struct.CuRuntime.html
+++ b/cu29/prelude/curuntime/struct.CuRuntime.html
@@ -1,4 +1,4 @@
-CuRuntime in cu29::prelude::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>
where +CuRuntime in cu29::prelude::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>{
     pub tasks: CT,
diff --git a/cu29/prelude/cutask/index.html b/cu29/prelude/cutask/index.html
index 18f833498..1752cd81a 100644
--- a/cu29/prelude/cutask/index.html
+++ b/cu29/prelude/cutask/index.html
@@ -1,4 +1,4 @@
-cu29::prelude::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement +cu29::prelude::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement or interact with to create a Copper task.

Structs§

CuCompactString
CuMsg
CuMsg is the envelope holding the msg payload and the metadata between tasks.
CuMsgMetadata
CuMsgMetadata is a structure that contains metadata common to all CuMsgs.

Traits§

CuMsgPack
CuMsgPayload
CuSinkTask
A Sink Task is a task that only consumes messages. For example drivers for actuators are Sink Tasks.
CuSrcTask
A Src Task is a task that only produces messages. For example drivers for sensors are Src Tasks. They are in push mode from the runtime. diff --git a/cu29/prelude/cutask/struct.CuCompactString.html b/cu29/prelude/cutask/struct.CuCompactString.html index d4090378b..74ccd6804 100644 --- a/cu29/prelude/cutask/struct.CuCompactString.html +++ b/cu29/prelude/cutask/struct.CuCompactString.html @@ -1,4 +1,4 @@ -CuCompactString in cu29::prelude::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where +CuCompactString in cu29::prelude::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: BorrowDecoder<'de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CuCompactString

Source§

fn clone(&self) -> CuCompactString

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 Debug for CuCompactString

Source§

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

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

impl Decode for CuCompactString

Source§

fn decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: Decoder,

Attempt to decode this type with the given Decode.
Source§

impl Default for CuCompactString

Source§

fn default() -> CuCompactString

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

impl<'de> Deserialize<'de> for CuCompactString

Source§

fn deserialize<__D>( __deserializer: __D, diff --git a/cu29/prelude/cutask/struct.CuMsg.html b/cu29/prelude/cutask/struct.CuMsg.html index be44f5ec2..40ee508d5 100644 --- a/cu29/prelude/cutask/struct.CuMsg.html +++ b/cu29/prelude/cutask/struct.CuMsg.html @@ -1,4 +1,4 @@ -CuMsg in cu29::prelude::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where +CuMsg in cu29::prelude::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where T: CuMsgPayload,
{ pub metadata: CuMsgMetadata, /* private fields */ diff --git a/cu29/prelude/cutask/struct.CuMsgMetadata.html b/cu29/prelude/cutask/struct.CuMsgMetadata.html index d27af61ff..de68c621e 100644 --- a/cu29/prelude/cutask/struct.CuMsgMetadata.html +++ b/cu29/prelude/cutask/struct.CuMsgMetadata.html @@ -1,4 +1,4 @@ -CuMsgMetadata in cu29::prelude::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
+CuMsgMetadata in cu29::prelude::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
     pub process_time: PartialCuTimeRange,
     pub tov: Tov,
     pub status_txt: CuCompactString,
diff --git a/cu29/prelude/cutask/trait.CuMsgPack.html b/cu29/prelude/cutask/trait.CuMsgPack.html
index 09b1b9f24..a30bda456 100644
--- a/cu29/prelude/cutask/trait.CuMsgPack.html
+++ b/cu29/prelude/cutask/trait.CuMsgPack.html
@@ -1,4 +1,4 @@
-CuMsgPack in cu29::prelude::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where +CuMsgPack in cu29::prelude::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl,

Source§

impl<'cl, T1, T2, T3> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>)
where T1: CuMsgPayload + 'cl, diff --git a/cu29/prelude/cutask/trait.CuMsgPayload.html b/cu29/prelude/cutask/trait.CuMsgPayload.html index 766cac935..42462b1b4 100644 --- a/cu29/prelude/cutask/trait.CuMsgPayload.html +++ b/cu29/prelude/cutask/trait.CuMsgPayload.html @@ -1,4 +1,4 @@ -CuMsgPayload in cu29::prelude::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
+CuMsgPayload in cu29::prelude::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
     Sized
     + Default
     + Debug
diff --git a/cu29/prelude/cutask/trait.CuSinkTask.html b/cu29/prelude/cutask/trait.CuSinkTask.html
index e4a29da97..f31bd95bb 100644
--- a/cu29/prelude/cutask/trait.CuSinkTask.html
+++ b/cu29/prelude/cutask/trait.CuSinkTask.html
@@ -1,4 +1,4 @@
-CuSinkTask in cu29::prelude::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
+CuSinkTask in cu29::prelude::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/prelude/cutask/trait.CuSrcTask.html b/cu29/prelude/cutask/trait.CuSrcTask.html
index 96b9a2b0b..c93dd9e50 100644
--- a/cu29/prelude/cutask/trait.CuSrcTask.html
+++ b/cu29/prelude/cutask/trait.CuSrcTask.html
@@ -1,4 +1,4 @@
-CuSrcTask in cu29::prelude::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
+CuSrcTask in cu29::prelude::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
     type Output: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/prelude/cutask/trait.CuTask.html b/cu29/prelude/cutask/trait.CuTask.html
index 74cba539c..7d7c4031c 100644
--- a/cu29/prelude/cutask/trait.CuTask.html
+++ b/cu29/prelude/cutask/trait.CuTask.html
@@ -1,4 +1,4 @@
-CuTask in cu29::prelude::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
+CuTask in cu29::prelude::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
     type Output: CuMsgPack<'cl>;
 
diff --git a/cu29/prelude/cutask/trait.Freezable.html b/cu29/prelude/cutask/trait.Freezable.html
index 92708d37d..d1ebde6ce 100644
--- a/cu29/prelude/cutask/trait.Freezable.html
+++ b/cu29/prelude/cutask/trait.Freezable.html
@@ -1,4 +1,4 @@
-Freezable in cu29::prelude::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
+Freezable in cu29::prelude::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
     // Provided methods
     fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
        where E: Encoder { ... }
diff --git a/cu29/prelude/enum.AllocatedSection.html b/cu29/prelude/enum.AllocatedSection.html
index bf44c2f51..53b4f1913 100644
--- a/cu29/prelude/enum.AllocatedSection.html
+++ b/cu29/prelude/enum.AllocatedSection.html
@@ -1,4 +1,4 @@
-AllocatedSection in cu29::prelude - Rust

Enum AllocatedSection

Source
pub enum AllocatedSection {
+AllocatedSection in cu29::prelude - Rust

Enum AllocatedSection

pub enum AllocatedSection {
     NoMoreSpace,
     Section(SectionHandle),
 }

Variants§

§

NoMoreSpace

§

Section(SectionHandle)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/cu29/prelude/enum.CopperListState.html b/cu29/prelude/enum.CopperListState.html index 4c1cd95b7..c9eb6035e 100644 --- a/cu29/prelude/enum.CopperListState.html +++ b/cu29/prelude/enum.CopperListState.html @@ -1,4 +1,4 @@ -CopperListState in cu29::prelude - Rust

Enum CopperListState

Source
pub enum CopperListState {
+CopperListState in cu29::prelude - Rust

Enum CopperListState

Source
pub enum CopperListState {
     Free,
     Initialized,
     Processing,
diff --git a/cu29/prelude/enum.CuExecutionUnit.html b/cu29/prelude/enum.CuExecutionUnit.html
index 1f3f71025..d7560365b 100644
--- a/cu29/prelude/enum.CuExecutionUnit.html
+++ b/cu29/prelude/enum.CuExecutionUnit.html
@@ -1,4 +1,4 @@
-CuExecutionUnit in cu29::prelude - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
+CuExecutionUnit in cu29::prelude - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
     Step(CuExecutionStep),
     Loop(CuExecutionLoop),
 }
Expand description

This structure represents a step in the execution plan.

diff --git a/cu29/prelude/enum.CuHandleInner.html b/cu29/prelude/enum.CuHandleInner.html index 680313edf..9edf5852b 100644 --- a/cu29/prelude/enum.CuHandleInner.html +++ b/cu29/prelude/enum.CuHandleInner.html @@ -1,4 +1,4 @@ -CuHandleInner in cu29::prelude - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T>
where +CuHandleInner in cu29::prelude - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T>
where T: Debug,
{ Pooled(ReusableOwned<T>), Detached(T), @@ -550,7 +550,7 @@
§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);
-
1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -567,10 +567,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -581,7 +583,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -597,7 +599,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());
-

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -617,7 +619,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);

-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -635,7 +637,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -658,7 +660,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -681,7 +683,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -702,7 +704,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -714,7 +716,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -731,7 +733,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -758,7 +760,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed

-

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -776,7 +778,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -794,7 +796,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);
-
Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -813,7 +815,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);

-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -828,7 +830,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());

-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -844,7 +846,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -864,7 +866,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);

-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -883,7 +885,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -906,7 +908,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -931,7 +933,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -956,7 +958,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -983,7 +985,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-

1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -998,7 +1000,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1027,7 +1029,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }

-

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1050,7 +1052,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1079,7 +1081,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1101,7 +1103,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1132,7 +1134,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1142,7 +1144,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1163,7 +1165,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1175,7 +1177,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1196,7 +1198,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1209,7 +1211,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1224,7 +1226,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1237,7 +1239,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1253,7 +1255,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1267,7 +1269,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1281,7 +1283,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1295,7 +1297,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1310,7 +1312,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1325,7 +1327,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1340,7 +1342,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1358,7 +1360,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1372,7 +1374,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1427,7 +1429,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1459,7 +1461,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1493,7 +1495,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1522,7 +1524,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1551,7 +1553,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1575,7 +1577,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1621,7 +1623,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1671,7 +1673,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1720,7 +1722,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1735,7 +1737,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1754,7 +1756,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1770,7 +1772,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1790,7 +1792,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1810,13 +1812,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1826,7 +1828,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1863,7 +1865,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1901,7 +1903,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1920,7 +1922,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1952,7 +1954,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1972,7 +1974,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1992,7 +1994,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2033,7 +2035,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2051,7 +2053,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2066,7 +2068,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2080,7 +2082,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2089,7 +2091,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2122,7 +2124,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2159,7 +2161,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2196,7 +2198,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2207,7 +2209,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2219,7 +2221,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2230,7 +2232,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2242,7 +2244,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2283,7 +2285,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2321,7 +2323,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2354,7 +2356,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2380,7 +2382,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2399,7 +2401,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2415,7 +2417,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2428,7 +2430,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2471,7 +2473,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2511,7 +2513,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2545,7 +2547,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2575,7 +2577,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2612,13 +2614,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2629,7 +2631,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2641,13 +2643,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2657,7 +2659,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2666,12 +2668,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29/prelude/enum.CuTaskCallbackState.html b/cu29/prelude/enum.CuTaskCallbackState.html index 47f3e4259..eacaa6cd3 100644 --- a/cu29/prelude/enum.CuTaskCallbackState.html +++ b/cu29/prelude/enum.CuTaskCallbackState.html @@ -1,4 +1,4 @@ -CuTaskCallbackState in cu29::prelude - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where +CuTaskCallbackState in cu29::prelude - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where I: CuMsgPack<'cl>, O: CuMsgPack<'cl>,
{ New(Option<ComponentConfig>), diff --git a/cu29/prelude/enum.CuTaskState.html b/cu29/prelude/enum.CuTaskState.html index 35f06442d..0ed8087a5 100644 --- a/cu29/prelude/enum.CuTaskState.html +++ b/cu29/prelude/enum.CuTaskState.html @@ -1,4 +1,4 @@ -CuTaskState in cu29::prelude - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
+CuTaskState in cu29::prelude - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
     Start,
     Preprocess,
     Process,
diff --git a/cu29/prelude/enum.CuTaskType.html b/cu29/prelude/enum.CuTaskType.html
index dcee41bd0..a04dabceb 100644
--- a/cu29/prelude/enum.CuTaskType.html
+++ b/cu29/prelude/enum.CuTaskType.html
@@ -1,4 +1,4 @@
-CuTaskType in cu29::prelude - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
+CuTaskType in cu29::prelude - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
     Source,
     Regular,
     Sink,
diff --git a/cu29/prelude/enum.Decision.html b/cu29/prelude/enum.Decision.html
index 3f208471b..db96c1bde 100644
--- a/cu29/prelude/enum.Decision.html
+++ b/cu29/prelude/enum.Decision.html
@@ -1,4 +1,4 @@
-Decision in cu29::prelude - Rust

Enum Decision

Source
pub enum Decision {
+Decision in cu29::prelude - Rust

Enum Decision

Source
pub enum Decision {
     Abort,
     Ignore,
     Shutdown,
diff --git a/cu29/prelude/enum.SimOverride.html b/cu29/prelude/enum.SimOverride.html
index 2607f229f..591a94375 100644
--- a/cu29/prelude/enum.SimOverride.html
+++ b/cu29/prelude/enum.SimOverride.html
@@ -1,4 +1,4 @@
-SimOverride in cu29::prelude - Rust

Enum SimOverride

Source
pub enum SimOverride {
+SimOverride in cu29::prelude - Rust

Enum SimOverride

Source
pub enum SimOverride {
     ExecutedBySim,
     ExecuteByRuntime,
     Errored(String),
diff --git a/cu29/prelude/enum.Tov.html b/cu29/prelude/enum.Tov.html
index ebf066f97..8a7e17ebd 100644
--- a/cu29/prelude/enum.Tov.html
+++ b/cu29/prelude/enum.Tov.html
@@ -1,4 +1,4 @@
-Tov in cu29::prelude - Rust

Enum Tov

pub enum Tov {
+Tov in cu29::prelude - Rust

Enum Tov

pub enum Tov {
     None,
     Time(CuDuration),
     Range(CuTimeRange),
diff --git a/cu29/prelude/enum.UnifiedLogType.html b/cu29/prelude/enum.UnifiedLogType.html
index 9c5d0f232..6c6cb7ea7 100644
--- a/cu29/prelude/enum.UnifiedLogType.html
+++ b/cu29/prelude/enum.UnifiedLogType.html
@@ -1,4 +1,4 @@
-UnifiedLogType in cu29::prelude - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
+UnifiedLogType in cu29::prelude - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
     Empty,
     StructuredLogLine,
     CopperList,
diff --git a/cu29/prelude/enum.UnifiedLogger.html b/cu29/prelude/enum.UnifiedLogger.html
index 14b8735b5..176b47df6 100644
--- a/cu29/prelude/enum.UnifiedLogger.html
+++ b/cu29/prelude/enum.UnifiedLogger.html
@@ -1,4 +1,4 @@
-UnifiedLogger in cu29::prelude - Rust

Enum UnifiedLogger

Source
pub enum UnifiedLogger {
+UnifiedLogger in cu29::prelude - Rust

Enum UnifiedLogger

pub enum UnifiedLogger {
     Read(UnifiedLoggerRead),
     Write(UnifiedLoggerWrite),
 }
Expand description

Holder of the read or write side of the datalogger.

diff --git a/cu29/prelude/enum.Value.html b/cu29/prelude/enum.Value.html index ca2376ad3..f496c7023 100644 --- a/cu29/prelude/enum.Value.html +++ b/cu29/prelude/enum.Value.html @@ -1,4 +1,4 @@ -Value in cu29::prelude - Rust

Enum Value

Source
pub enum Value {
+Value in cu29::prelude - Rust

Enum Value

Source
pub enum Value {
 
Show 20 variants Bool(bool), U8(u8), U16(u16), diff --git a/cu29/prelude/fn.compute_runtime_plan.html b/cu29/prelude/fn.compute_runtime_plan.html index a8963f720..81c5f7a90 100644 --- a/cu29/prelude/fn.compute_runtime_plan.html +++ b/cu29/prelude/fn.compute_runtime_plan.html @@ -1,4 +1,4 @@ -compute_runtime_plan in cu29::prelude - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
+compute_runtime_plan in cu29::prelude - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(
     config: &CuConfig,
 ) -> Result<CuExecutionLoop, CuError>
Expand description

This is the main heuristics to compute an execution plan at compilation time. TODO: Make that heuristic pluggable.

diff --git a/cu29/prelude/fn.default_log_index_dir.html b/cu29/prelude/fn.default_log_index_dir.html index 9887ac75f..86db7ada8 100644 --- a/cu29/prelude/fn.default_log_index_dir.html +++ b/cu29/prelude/fn.default_log_index_dir.html @@ -1,2 +1,2 @@ -default_log_index_dir in cu29::prelude - Rust

Function default_log_index_dir

pub fn default_log_index_dir() -> PathBuf
Expand description

Convenience function to returns the default path for the log index directory.

+default_log_index_dir in cu29::prelude - Rust

Function default_log_index_dir

pub fn default_log_index_dir() -> PathBuf
Expand description

Convenience function to returns the default path for the log index directory.

\ No newline at end of file diff --git a/cu29/prelude/fn.find_task_type_for_id.html b/cu29/prelude/fn.find_task_type_for_id.html index d2cfbdb75..4658e5378 100644 --- a/cu29/prelude/fn.find_task_type_for_id.html +++ b/cu29/prelude/fn.find_task_type_for_id.html @@ -1,4 +1,4 @@ -find_task_type_for_id in cu29::prelude - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
+find_task_type_for_id in cu29::prelude - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
     graph: &StableGraph<Node, Cnx>,
     node_id: u32,
 ) -> CuTaskType
\ No newline at end of file diff --git a/cu29/prelude/fn.format_logline.html b/cu29/prelude/fn.format_logline.html index 355a1b26d..e4924d30c 100644 --- a/cu29/prelude/fn.format_logline.html +++ b/cu29/prelude/fn.format_logline.html @@ -1,4 +1,4 @@ -format_logline in cu29::prelude - Rust

Function format_logline

pub fn format_logline(
+format_logline in cu29::prelude - Rust

Function format_logline

pub fn format_logline(
     time: CuDuration,
     format_str: &str,
     params: &[String],
diff --git a/cu29/prelude/fn.log.html b/cu29/prelude/fn.log.html
index 8729e0dae..39978119a 100644
--- a/cu29/prelude/fn.log.html
+++ b/cu29/prelude/fn.log.html
@@ -1,3 +1,3 @@
-log in cu29::prelude - Rust

Function log

pub fn log(entry: &mut CuLogEntry) -> Result<(), CuError>
Expand description

Function called from generated code to log data. +log in cu29::prelude - Rust

Function log

pub fn log(entry: &mut CuLogEntry) -> Result<(), CuError>
Expand description

Function called from generated code to log data. It moves entry by design, it will be absorbed in the queue.

\ No newline at end of file diff --git a/cu29/prelude/fn.log_debug_mode.html b/cu29/prelude/fn.log_debug_mode.html index e02ee122c..414433c78 100644 --- a/cu29/prelude/fn.log_debug_mode.html +++ b/cu29/prelude/fn.log_debug_mode.html @@ -1,4 +1,4 @@ -log_debug_mode in cu29::prelude - Rust

Function log_debug_mode

pub fn log_debug_mode(
+log_debug_mode in cu29::prelude - Rust

Function log_debug_mode

pub fn log_debug_mode(
     entry: &mut CuLogEntry,
     format_str: &str,
     param_names: &[&str],
diff --git a/cu29/prelude/fn.pools_statistics.html b/cu29/prelude/fn.pools_statistics.html
index 10285f427..005f21bfb 100644
--- a/cu29/prelude/fn.pools_statistics.html
+++ b/cu29/prelude/fn.pools_statistics.html
@@ -1,3 +1,3 @@
-pools_statistics in cu29::prelude - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. +pools_statistics in cu29::prelude - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. We use SmallVec here to avoid heap allocations while the stack is running.

\ No newline at end of file diff --git a/cu29/prelude/fn.read_configuration.html b/cu29/prelude/fn.read_configuration.html index 1548ae1b6..09c906eff 100644 --- a/cu29/prelude/fn.read_configuration.html +++ b/cu29/prelude/fn.read_configuration.html @@ -1,2 +1,2 @@ -read_configuration in cu29::prelude - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29::prelude - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29/prelude/fn.read_configuration_str.html b/cu29/prelude/fn.read_configuration_str.html index 60c51e63e..d9fa91c43 100644 --- a/cu29/prelude/fn.read_configuration_str.html +++ b/cu29/prelude/fn.read_configuration_str.html @@ -1,4 +1,4 @@ -read_configuration_str in cu29::prelude - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
+read_configuration_str in cu29::prelude - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(
     config_content: String,
 ) -> Result<CuConfig, CuError>
Expand description

Read a copper configuration from a String.

\ No newline at end of file diff --git a/cu29/prelude/fn.read_interned_strings.html b/cu29/prelude/fn.read_interned_strings.html index 11a9139b5..16c618d52 100644 --- a/cu29/prelude/fn.read_interned_strings.html +++ b/cu29/prelude/fn.read_interned_strings.html @@ -1,2 +1,2 @@ -read_interned_strings in cu29::prelude - Rust

Function read_interned_strings

pub fn read_interned_strings(index: &Path) -> Result<Vec<String>, CuError>
Expand description

Rebuild the interned string index in memory.

+read_interned_strings in cu29::prelude - Rust

Function read_interned_strings

Source
pub fn read_interned_strings(index: &Path) -> Result<Vec<String>, CuError>
Expand description

Rebuild the interned string index in memory.

\ No newline at end of file diff --git a/cu29/prelude/fn.rebuild_logline.html b/cu29/prelude/fn.rebuild_logline.html index 98f58950d..f003c28de 100644 --- a/cu29/prelude/fn.rebuild_logline.html +++ b/cu29/prelude/fn.rebuild_logline.html @@ -1,4 +1,4 @@ -rebuild_logline in cu29::prelude - Rust

Function rebuild_logline

pub fn rebuild_logline(
+rebuild_logline in cu29::prelude - Rust

Function rebuild_logline

pub fn rebuild_logline(
     all_interned_strings: &[String],
     entry: &CuLogEntry,
 ) -> Result<String, CuError>
Expand description

Rebuild a log line from the interned strings and the CuLogEntry. diff --git a/cu29/prelude/fn.stream_write.html b/cu29/prelude/fn.stream_write.html index a873df825..20887d470 100644 --- a/cu29/prelude/fn.stream_write.html +++ b/cu29/prelude/fn.stream_write.html @@ -1,4 +1,4 @@ -stream_write in cu29::prelude - Rust

Function stream_write

Source
pub fn stream_write<E>(
+stream_write in cu29::prelude - Rust

Function stream_write

pub fn stream_write<E>(
     logger: Arc<Mutex<UnifiedLoggerWrite>>,
     entry_type: UnifiedLogType,
     minimum_allocation_amount: usize,
diff --git a/cu29/prelude/fn.to_value.html b/cu29/prelude/fn.to_value.html
index d4eb688f2..1922dfda9 100644
--- a/cu29/prelude/fn.to_value.html
+++ b/cu29/prelude/fn.to_value.html
@@ -1,2 +1,2 @@
-to_value in cu29::prelude - Rust

Function to_value

Source
pub fn to_value<T>(value: T) -> Result<Value, SerializerError>
where +to_value in cu29::prelude - Rust

Function to_value

Source
pub fn to_value<T>(value: T) -> Result<Value, SerializerError>
where T: Serialize,
\ No newline at end of file diff --git a/cu29/prelude/index.html b/cu29/prelude/index.html index 75e72504d..94ba9ef20 100644 --- a/cu29/prelude/index.html +++ b/cu29/prelude/index.html @@ -1,4 +1,4 @@ -cu29::prelude - Rust

Module prelude

Source

Modules§

config
This module defines the configuration of the copper runtime. +cu29::prelude - Rust

Module prelude

Source

Modules§

config
This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.
copperlist
CopperList is the main data structure used by Copper to communicate between tasks. diff --git a/cu29/prelude/macro.debug.html b/cu29/prelude/macro.debug.html index f6bafb9f4..e19cf40a9 100644 --- a/cu29/prelude/macro.debug.html +++ b/cu29/prelude/macro.debug.html @@ -1,4 +1,4 @@ -debug in cu29::prelude - Rust

Macro debug

Source
debug!() { /* proc-macro */ }
Expand description

This macro is used to log a message with parameters. +debug in cu29::prelude - Rust

Macro debug

Source
debug!() { /* proc-macro */ }
Expand description

This macro is used to log a message with parameters. The first parameter is a string literal that represents the message to be logged. Only {} is supported as a placeholder for parameters. The rest of the parameters are the values to be logged. diff --git a/cu29/prelude/macro.gen_cumsgs.html b/cu29/prelude/macro.gen_cumsgs.html index 41865dc22..ebce25337 100644 --- a/cu29/prelude/macro.gen_cumsgs.html +++ b/cu29/prelude/macro.gen_cumsgs.html @@ -1,4 +1,4 @@ -gen_cumsgs in cu29::prelude - Rust

Macro gen_cumsgs

Source
gen_cumsgs!() { /* proc-macro */ }
Expand description

Generates the CopperList content type from a config. +gen_cumsgs in cu29::prelude - Rust

Macro gen_cumsgs

Source
gen_cumsgs!() { /* proc-macro */ }
Expand description

Generates the CopperList content type from a config. gen_cumsgs!(“path/to/config.toml”) It will create a new type called CuMsgs you can pass to the log reader for decoding:

\ No newline at end of file diff --git a/cu29/prelude/macro.input_msg.html b/cu29/prelude/macro.input_msg.html index 0fdc859d1..43da1059a 100644 --- a/cu29/prelude/macro.input_msg.html +++ b/cu29/prelude/macro.input_msg.html @@ -1,4 +1,4 @@ -input_msg in cu29::prelude - Rust

Macro input_msg

Source
macro_rules! input_msg {
+input_msg in cu29::prelude - Rust

Macro input_msg

Source
macro_rules! input_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
     ($lifetime:lifetime, $($ty:ty),*) => { ... };
 }
\ No newline at end of file diff --git a/cu29/prelude/macro.output_msg.html b/cu29/prelude/macro.output_msg.html index a33201097..7772ff603 100644 --- a/cu29/prelude/macro.output_msg.html +++ b/cu29/prelude/macro.output_msg.html @@ -1,3 +1,3 @@ -output_msg in cu29::prelude - Rust

Macro output_msg

Source
macro_rules! output_msg {
+output_msg in cu29::prelude - Rust

Macro output_msg

Source
macro_rules! output_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
 }
\ No newline at end of file diff --git a/cu29/prelude/monitoring/enum.CuTaskState.html b/cu29/prelude/monitoring/enum.CuTaskState.html index ea3fb6d64..db7e2a5e8 100644 --- a/cu29/prelude/monitoring/enum.CuTaskState.html +++ b/cu29/prelude/monitoring/enum.CuTaskState.html @@ -1,4 +1,4 @@ -CuTaskState in cu29::prelude::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
+CuTaskState in cu29::prelude::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
     Start,
     Preprocess,
     Process,
diff --git a/cu29/prelude/monitoring/enum.Decision.html b/cu29/prelude/monitoring/enum.Decision.html
index 10c61e35f..e87b0a2cc 100644
--- a/cu29/prelude/monitoring/enum.Decision.html
+++ b/cu29/prelude/monitoring/enum.Decision.html
@@ -1,4 +1,4 @@
-Decision in cu29::prelude::monitoring - Rust

Enum Decision

Source
pub enum Decision {
+Decision in cu29::prelude::monitoring - Rust

Enum Decision

Source
pub enum Decision {
     Abort,
     Ignore,
     Shutdown,
diff --git a/cu29/prelude/monitoring/index.html b/cu29/prelude/monitoring/index.html
index 177b83bd3..09292d413 100644
--- a/cu29/prelude/monitoring/index.html
+++ b/cu29/prelude/monitoring/index.html
@@ -1,4 +1,4 @@
-cu29::prelude::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

+cu29::prelude::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

Structs§

CountingAllocator
A simple allocator that counts the number of bytes allocated and deallocated.
CuDurationStatistics
A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.
LiveStatistics
Accumulative stat object that can give your some real time statistics.
NoMonitor
A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.
ScopedAllocCounter
A simple struct that counts the number of bytes allocated and deallocated in a scope.

Enums§

CuTaskState
The state of a task.
Decision
Monitor decision to be taken when a task errored out.

Statics§

GLOBAL

Traits§

CuMonitor
Trait to implement a monitoring task.
\ No newline at end of file diff --git a/cu29/prelude/monitoring/static.GLOBAL.html b/cu29/prelude/monitoring/static.GLOBAL.html index 091def94a..266b2fa25 100644 --- a/cu29/prelude/monitoring/static.GLOBAL.html +++ b/cu29/prelude/monitoring/static.GLOBAL.html @@ -1 +1 @@ -GLOBAL in cu29::prelude::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file +GLOBAL in cu29::prelude::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file diff --git a/cu29/prelude/monitoring/struct.CountingAllocator.html b/cu29/prelude/monitoring/struct.CountingAllocator.html index d455aeed7..9c578a724 100644 --- a/cu29/prelude/monitoring/struct.CountingAllocator.html +++ b/cu29/prelude/monitoring/struct.CountingAllocator.html @@ -1,4 +1,4 @@ -CountingAllocator in cu29::prelude::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

+CountingAllocator in cu29::prelude::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

Implementations§

Trait Implementations§

Source§

impl Default for CountingAllocator

Source§

fn default() -> CountingAllocator

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

impl GlobalAlloc for CountingAllocator

Source§

unsafe fn alloc(&self, layout: Layout) -> *mut u8

Allocates memory as described by the given layout. Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)

Deallocates the block of memory at the given ptr pointer with the given layout. Read more
1.28.0 · Source§

unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more
1.28.0 · Source§

unsafe fn realloc( &self, diff --git a/cu29/prelude/monitoring/struct.CuDurationStatistics.html b/cu29/prelude/monitoring/struct.CuDurationStatistics.html index a4392936c..0d64c5936 100644 --- a/cu29/prelude/monitoring/struct.CuDurationStatistics.html +++ b/cu29/prelude/monitoring/struct.CuDurationStatistics.html @@ -1,4 +1,4 @@ -CuDurationStatistics in cu29::prelude::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. +CuDurationStatistics in cu29::prelude::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.

Implementations§

Source§

impl CuDurationStatistics

Source

pub fn new(max: CuDuration) -> CuDurationStatistics

Source

pub fn min(&self) -> CuDuration

Source

pub fn max(&self) -> CuDuration

Source

pub fn mean(&self) -> CuDuration

Source

pub fn percentile(&self, percentile: f64) -> CuDuration

Source

pub fn stddev(&self) -> CuDuration

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn jitter_min(&self) -> CuDuration

Source

pub fn jitter_max(&self) -> CuDuration

Source

pub fn jitter_mean(&self) -> CuDuration

Source

pub fn jitter_stddev(&self) -> CuDuration

Source

pub fn jitter_percentile(&self, percentile: f64) -> CuDuration

Source

pub fn record(&mut self, value: CuDuration)

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for CuDurationStatistics

Source§

fn clone(&self) -> CuDurationStatistics

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 Debug for CuDurationStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/monitoring/struct.LiveStatistics.html b/cu29/prelude/monitoring/struct.LiveStatistics.html index f372ec7f7..c010bf446 100644 --- a/cu29/prelude/monitoring/struct.LiveStatistics.html +++ b/cu29/prelude/monitoring/struct.LiveStatistics.html @@ -1,4 +1,4 @@ -LiveStatistics in cu29::prelude::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

+LiveStatistics in cu29::prelude::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

Implementations§

Source§

impl LiveStatistics

Source

pub fn new_unbounded() -> LiveStatistics

Source

pub fn new_with_max(max: u64) -> LiveStatistics

Source

pub fn min(&self) -> u64

Source

pub fn max(&self) -> u64

Source

pub fn mean(&self) -> f64

Source

pub fn percentile(&self, percentile: f64) -> u64

Source

pub fn record(&mut self, value: u64)

Adds a value to the statistics.

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for LiveStatistics

Source§

fn clone(&self) -> LiveStatistics

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 Debug for LiveStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/monitoring/struct.NoMonitor.html b/cu29/prelude/monitoring/struct.NoMonitor.html index e81285918..5aa45cc03 100644 --- a/cu29/prelude/monitoring/struct.NoMonitor.html +++ b/cu29/prelude/monitoring/struct.NoMonitor.html @@ -1,4 +1,4 @@ -NoMonitor in cu29::prelude::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. +NoMonitor in cu29::prelude::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.

Trait Implementations§

Source§

impl CuMonitor for NoMonitor

Source§

fn new( _config: &CuConfig, diff --git a/cu29/prelude/monitoring/struct.ScopedAllocCounter.html b/cu29/prelude/monitoring/struct.ScopedAllocCounter.html index 9bfcc6dfc..6895b9940 100644 --- a/cu29/prelude/monitoring/struct.ScopedAllocCounter.html +++ b/cu29/prelude/monitoring/struct.ScopedAllocCounter.html @@ -1,4 +1,4 @@ -ScopedAllocCounter in cu29::prelude::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

+ScopedAllocCounter in cu29::prelude::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

Implementations§

Source§

impl ScopedAllocCounter

Source

pub fn new() -> ScopedAllocCounter

Source

pub fn get_allocated(&self) -> usize

Returns the total number of bytes allocated in the current scope since the creation of this ScopedAllocCounter.

§Example
diff --git a/cu29/prelude/monitoring/trait.CuMonitor.html b/cu29/prelude/monitoring/trait.CuMonitor.html index c57367a53..5739b0ea3 100644 --- a/cu29/prelude/monitoring/trait.CuMonitor.html +++ b/cu29/prelude/monitoring/trait.CuMonitor.html @@ -1,4 +1,4 @@ -CuMonitor in cu29::prelude::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
+CuMonitor in cu29::prelude::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
     // Required methods
     fn new(
         config: &CuConfig,
diff --git a/cu29/prelude/payload/index.html b/cu29/prelude/payload/index.html
index 9d89b83c9..2a7e691ec 100644
--- a/cu29/prelude/payload/index.html
+++ b/cu29/prelude/payload/index.html
@@ -1 +1 @@
-cu29::prelude::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file +cu29::prelude::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file diff --git a/cu29/prelude/payload/struct.CuArray.html b/cu29/prelude/payload/struct.CuArray.html index 858401959..07d0a8a37 100644 --- a/cu29/prelude/payload/struct.CuArray.html +++ b/cu29/prelude/payload/struct.CuArray.html @@ -1,4 +1,4 @@ -CuArray in cu29::prelude::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

+CuArray in cu29::prelude::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

Implementations§

Source§

impl<T, const N: usize> CuArray<T, N>

Source

pub fn new() -> CuArray<T, N>

Source

pub fn fill_from_iter<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn capacity(&self) -> usize

Trait Implementations§

Source§

impl<T, const N: usize> Clone for CuArray<T, N>
where T: Clone,

Source§

fn clone(&self) -> CuArray<T, N>

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<T, const N: usize> Debug for CuArray<T, N>
where diff --git a/cu29/prelude/pool/enum.CuHandleInner.html b/cu29/prelude/pool/enum.CuHandleInner.html index cd135e2db..1619d4342 100644 --- a/cu29/prelude/pool/enum.CuHandleInner.html +++ b/cu29/prelude/pool/enum.CuHandleInner.html @@ -1,4 +1,4 @@ -CuHandleInner in cu29::prelude::pool - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T>
where +CuHandleInner in cu29::prelude::pool - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T>
where T: Debug,
{ Pooled(ReusableOwned<T>), Detached(T), @@ -550,7 +550,7 @@
§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);
-

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -567,10 +567,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -581,7 +583,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -597,7 +599,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -617,7 +619,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);

-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -635,7 +637,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -658,7 +660,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -681,7 +683,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -702,7 +704,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -714,7 +716,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -731,7 +733,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -758,7 +760,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -776,7 +778,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -794,7 +796,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);
-
Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -813,7 +815,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -828,7 +830,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -844,7 +846,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -864,7 +866,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -883,7 +885,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -906,7 +908,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -931,7 +933,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -956,7 +958,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -983,7 +985,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -998,7 +1000,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1027,7 +1029,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1050,7 +1052,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1079,7 +1081,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1101,7 +1103,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1132,7 +1134,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1142,7 +1144,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1163,7 +1165,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1175,7 +1177,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1196,7 +1198,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1209,7 +1211,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1224,7 +1226,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1237,7 +1239,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1253,7 +1255,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1267,7 +1269,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1281,7 +1283,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1295,7 +1297,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1310,7 +1312,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1325,7 +1327,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1340,7 +1342,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1358,7 +1360,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1372,7 +1374,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1427,7 +1429,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1459,7 +1461,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1493,7 +1495,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1522,7 +1524,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1551,7 +1553,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1575,7 +1577,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1621,7 +1623,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1671,7 +1673,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1720,7 +1722,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1735,7 +1737,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1754,7 +1756,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1770,7 +1772,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1790,7 +1792,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1810,13 +1812,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1826,7 +1828,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1863,7 +1865,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1901,7 +1903,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1920,7 +1922,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1952,7 +1954,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1972,7 +1974,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1992,7 +1994,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2033,7 +2035,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2051,7 +2053,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2066,7 +2068,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2080,7 +2082,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2089,7 +2091,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2122,7 +2124,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2159,7 +2161,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2196,7 +2198,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2207,7 +2209,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2219,7 +2221,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2230,7 +2232,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2242,7 +2244,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2283,7 +2285,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2321,7 +2323,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2354,7 +2356,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2380,7 +2382,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2399,7 +2401,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2415,7 +2417,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2428,7 +2430,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2471,7 +2473,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2511,7 +2513,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2545,7 +2547,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2575,7 +2577,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2612,13 +2614,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2629,7 +2631,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2641,13 +2643,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2657,7 +2659,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2666,12 +2668,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29/prelude/pool/fn.pools_statistics.html b/cu29/prelude/pool/fn.pools_statistics.html index 9043cf957..962cab73b 100644 --- a/cu29/prelude/pool/fn.pools_statistics.html +++ b/cu29/prelude/pool/fn.pools_statistics.html @@ -1,3 +1,3 @@ -pools_statistics in cu29::prelude::pool - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. +pools_statistics in cu29::prelude::pool - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. We use SmallVec here to avoid heap allocations while the stack is running.

\ No newline at end of file diff --git a/cu29/prelude/pool/index.html b/cu29/prelude/pool/index.html index fa4d24a26..f48c559ce 100644 --- a/cu29/prelude/pool/index.html +++ b/cu29/prelude/pool/index.html @@ -1,4 +1,4 @@ -cu29::prelude::pool - Rust

Module pool

Source

Structs§

AlignedBuffer
A buffer that is aligned to a specific size with the Element of type E.
CuHandle
A shareable handle to an Array coming from a pool (either host or device).
CuHostMemoryPool
A pool of host memory buffers.

Enums§

CuHandleInner
A Handle to a Buffer. +cu29::prelude::pool - Rust

Module pool

Source

Structs§

AlignedBuffer
A buffer that is aligned to a specific size with the Element of type E.
CuHandle
A shareable handle to an Array coming from a pool (either host or device).
CuHostMemoryPool
A pool of host memory buffers.

Enums§

CuHandleInner
A Handle to a Buffer. For onboard usages, the buffer should be Pooled (ie, coming from a preallocated pool). The Detached version is for offline usages where we don’t really need a pool to deserialize them.

Traits§

ArrayLike
CuPool
A CuPool is a pool of buffers that can be shared between different parts of the code. Handles can be stored locally in the tasks and shared between them.
DeviceCuPool
A device memory pool can copy data from a device to a host memory pool on top.
ElementType
Basic Type that can be used in a buffer in a CuPool.
PoolMonitor
Trait for a Pool to exposed to be monitored by the monitoring API.

Functions§

pools_statistics
Get the list of pools and their statistics. diff --git a/cu29/prelude/pool/struct.AlignedBuffer.html b/cu29/prelude/pool/struct.AlignedBuffer.html index fa21b8f4a..0c7efef37 100644 --- a/cu29/prelude/pool/struct.AlignedBuffer.html +++ b/cu29/prelude/pool/struct.AlignedBuffer.html @@ -1,4 +1,4 @@ -AlignedBuffer in cu29::prelude::pool - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E>
where +AlignedBuffer in cu29::prelude::pool - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E>
where E: ElementType,
{ /* private fields */ }
Expand description

A buffer that is aligned to a specific size with the Element of type E.

Implementations§

Source§

impl<E> AlignedBuffer<E>
where E: ElementType,

Source

pub fn new(num_elements: usize, alignment: usize) -> AlignedBuffer<E>

Methods from Deref<Target = [E]>§

Source

pub fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
where @@ -546,7 +546,7 @@
§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);

-
1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -563,10 +563,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -577,7 +579,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -593,7 +595,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -613,7 +615,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -631,7 +633,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -654,7 +656,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -677,7 +679,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -698,7 +700,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -710,7 +712,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -727,7 +729,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -754,7 +756,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -772,7 +774,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -790,7 +792,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);
-
Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -809,7 +811,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -824,7 +826,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -840,7 +842,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -860,7 +862,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -879,7 +881,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -902,7 +904,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -927,7 +929,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -952,7 +954,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -979,7 +981,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -994,7 +996,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1023,7 +1025,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1046,7 +1048,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1075,7 +1077,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1097,7 +1099,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1128,7 +1130,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1138,7 +1140,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1159,7 +1161,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1171,7 +1173,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1192,7 +1194,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1205,7 +1207,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1220,7 +1222,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1233,7 +1235,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1249,7 +1251,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1263,7 +1265,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1277,7 +1279,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1291,7 +1293,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1306,7 +1308,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1321,7 +1323,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1336,7 +1338,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1354,7 +1356,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1368,7 +1370,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1423,7 +1425,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1455,7 +1457,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1489,7 +1491,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1518,7 +1520,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1547,7 +1549,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1571,7 +1573,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1617,7 +1619,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1667,7 +1669,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1716,7 +1718,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1731,7 +1733,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1750,7 +1752,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1766,7 +1768,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1786,7 +1788,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1806,13 +1808,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1822,7 +1824,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1859,7 +1861,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1897,7 +1899,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1916,7 +1918,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1948,7 +1950,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1968,7 +1970,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1988,7 +1990,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2029,7 +2031,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2047,7 +2049,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2062,7 +2064,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2076,7 +2078,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2085,7 +2087,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2118,7 +2120,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2155,7 +2157,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2192,7 +2194,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2203,7 +2205,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2215,7 +2217,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2226,7 +2228,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2238,7 +2240,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2279,7 +2281,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2317,7 +2319,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2350,7 +2352,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2376,7 +2378,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2395,7 +2397,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2411,7 +2413,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2424,7 +2426,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2467,7 +2469,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2507,7 +2509,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2541,7 +2543,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2571,7 +2573,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2608,13 +2610,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2625,7 +2627,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2637,13 +2639,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2653,7 +2655,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2662,12 +2664,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29/prelude/pool/struct.CuHandle.html b/cu29/prelude/pool/struct.CuHandle.html index b469be1e6..9a25071ea 100644 --- a/cu29/prelude/pool/struct.CuHandle.html +++ b/cu29/prelude/pool/struct.CuHandle.html @@ -1,4 +1,4 @@ -CuHandle in cu29::prelude::pool - Rust

Struct CuHandle

Source
pub struct CuHandle<T>(/* private fields */)
+CuHandle in cu29::prelude::pool - Rust

Struct CuHandle

Source
pub struct CuHandle<T>(/* private fields */)
 where
     T: ArrayLike;
Expand description

A shareable handle to an Array coming from a pool (either host or device).

Implementations§

Source§

impl<T> CuHandle<T>
where diff --git a/cu29/prelude/pool/struct.CuHostMemoryPool.html b/cu29/prelude/pool/struct.CuHostMemoryPool.html index c4edf6bfa..d182f4e9b 100644 --- a/cu29/prelude/pool/struct.CuHostMemoryPool.html +++ b/cu29/prelude/pool/struct.CuHostMemoryPool.html @@ -1,4 +1,4 @@ -CuHostMemoryPool in cu29::prelude::pool - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

+CuHostMemoryPool in cu29::prelude::pool - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

Implementations§

Source§

impl<T> CuHostMemoryPool<T>
where T: ArrayLike + 'static,

Source

pub fn new<F>( id: &str, diff --git a/cu29/prelude/pool/trait.ArrayLike.html b/cu29/prelude/pool/trait.ArrayLike.html index 156fe6eff..1b7b85480 100644 --- a/cu29/prelude/pool/trait.ArrayLike.html +++ b/cu29/prelude/pool/trait.ArrayLike.html @@ -1,4 +1,4 @@ -ArrayLike in cu29::prelude::pool - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
+ArrayLike in cu29::prelude::pool - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
     Deref<Target = [Self::Element]>
     + DerefMut
     + Debug
diff --git a/cu29/prelude/pool/trait.CuPool.html b/cu29/prelude/pool/trait.CuPool.html
index 63dcd08fa..55d3d1a2d 100644
--- a/cu29/prelude/pool/trait.CuPool.html
+++ b/cu29/prelude/pool/trait.CuPool.html
@@ -1,4 +1,4 @@
-CuPool in cu29::prelude::pool - Rust

Trait CuPool

Source
pub trait CuPool<T>: PoolMonitor
where +CuPool in cu29::prelude::pool - Rust

Trait CuPool

Source
pub trait CuPool<T>: PoolMonitor
where T: ArrayLike,
{ // Required methods fn acquire(&self) -> Option<CuHandle<T>>; diff --git a/cu29/prelude/pool/trait.DeviceCuPool.html b/cu29/prelude/pool/trait.DeviceCuPool.html index 9ad240433..52c47f196 100644 --- a/cu29/prelude/pool/trait.DeviceCuPool.html +++ b/cu29/prelude/pool/trait.DeviceCuPool.html @@ -1,4 +1,4 @@ -DeviceCuPool in cu29::prelude::pool - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T>: CuPool<T>
where +DeviceCuPool in cu29::prelude::pool - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T>: CuPool<T>
where T: ArrayLike,
{ // Required method fn copy_to_host_pool<O>( diff --git a/cu29/prelude/pool/trait.ElementType.html b/cu29/prelude/pool/trait.ElementType.html index 93b08f352..ea8acbdcf 100644 --- a/cu29/prelude/pool/trait.ElementType.html +++ b/cu29/prelude/pool/trait.ElementType.html @@ -1,4 +1,4 @@ -ElementType in cu29::prelude::pool - Rust

Trait ElementType

Source
pub trait ElementType:
+ElementType in cu29::prelude::pool - Rust

Trait ElementType

Source
pub trait ElementType:
     Sized
     + Default
     + Copy
diff --git a/cu29/prelude/pool/trait.PoolMonitor.html b/cu29/prelude/pool/trait.PoolMonitor.html
index 56f549ae3..1f70cfec8 100644
--- a/cu29/prelude/pool/trait.PoolMonitor.html
+++ b/cu29/prelude/pool/trait.PoolMonitor.html
@@ -1,4 +1,4 @@
-PoolMonitor in cu29::prelude::pool - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
+PoolMonitor in cu29::prelude::pool - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
     // Required methods
     fn id(&self) -> ArrayString<64>;
     fn space_left(&self) -> usize;
diff --git a/cu29/prelude/simulation/enum.CuTaskCallbackState.html b/cu29/prelude/simulation/enum.CuTaskCallbackState.html
index 00093cd50..feed09aa2 100644
--- a/cu29/prelude/simulation/enum.CuTaskCallbackState.html
+++ b/cu29/prelude/simulation/enum.CuTaskCallbackState.html
@@ -1,4 +1,4 @@
-CuTaskCallbackState in cu29::prelude::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where +CuTaskCallbackState in cu29::prelude::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where I: CuMsgPack<'cl>, O: CuMsgPack<'cl>,
{ New(Option<ComponentConfig>), diff --git a/cu29/prelude/simulation/enum.SimOverride.html b/cu29/prelude/simulation/enum.SimOverride.html index 2071dbf45..48249dd44 100644 --- a/cu29/prelude/simulation/enum.SimOverride.html +++ b/cu29/prelude/simulation/enum.SimOverride.html @@ -1,4 +1,4 @@ -SimOverride in cu29::prelude::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
+SimOverride in cu29::prelude::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
     ExecutedBySim,
     ExecuteByRuntime,
     Errored(String),
diff --git a/cu29/prelude/simulation/index.html b/cu29/prelude/simulation/index.html
index 607d2d9d1..8c57959fa 100644
--- a/cu29/prelude/simulation/index.html
+++ b/cu29/prelude/simulation/index.html
@@ -1,4 +1,4 @@
-cu29::prelude::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

+cu29::prelude::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

The cu29::simulation module provides an interface to simulate tasks in Copper-based systems. It offers structures, traits, and enums that enable hooking into the lifecycle of tasks, adapting their behavior, and integrating them with simulated hardware environments.

diff --git a/cu29/prelude/simulation/struct.CuSimSinkTask.html b/cu29/prelude/simulation/struct.CuSimSinkTask.html index d694e3537..b3533307d 100644 --- a/cu29/prelude/simulation/struct.CuSimSinkTask.html +++ b/cu29/prelude/simulation/struct.CuSimSinkTask.html @@ -1,4 +1,4 @@ -CuSimSinkTask in cu29::prelude::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. +CuSimSinkTask in cu29::prelude::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSinkTask<'cl> for CuSimSinkTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Input = &'cl CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSinkTask<T>, CuError>
where diff --git a/cu29/prelude/simulation/struct.CuSimSrcTask.html b/cu29/prelude/simulation/struct.CuSimSrcTask.html index 2e6f956be..035726645 100644 --- a/cu29/prelude/simulation/struct.CuSimSrcTask.html +++ b/cu29/prelude/simulation/struct.CuSimSrcTask.html @@ -1,4 +1,4 @@ -CuSimSrcTask in cu29::prelude::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. +CuSimSrcTask in cu29::prelude::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSrcTask<'cl> for CuSimSrcTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Output = &'cl mut CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSrcTask<T>, CuError>
where diff --git a/cu29/prelude/static.EXTRA_TEXT_LOGGER.html b/cu29/prelude/static.EXTRA_TEXT_LOGGER.html index e899e47e0..97ca35000 100644 --- a/cu29/prelude/static.EXTRA_TEXT_LOGGER.html +++ b/cu29/prelude/static.EXTRA_TEXT_LOGGER.html @@ -1 +1 @@ -EXTRA_TEXT_LOGGER in cu29::prelude - Rust

Static EXTRA_TEXT_LOGGER

pub static EXTRA_TEXT_LOGGER: RwLock<Option<Box<dyn Log>>>
\ No newline at end of file +EXTRA_TEXT_LOGGER in cu29::prelude - Rust

Static EXTRA_TEXT_LOGGER

pub static EXTRA_TEXT_LOGGER: RwLock<Option<Box<dyn Log>>>
\ No newline at end of file diff --git a/cu29/prelude/static.GLOBAL.html b/cu29/prelude/static.GLOBAL.html index 208a1815c..ce0814522 100644 --- a/cu29/prelude/static.GLOBAL.html +++ b/cu29/prelude/static.GLOBAL.html @@ -1 +1 @@ -GLOBAL in cu29::prelude - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file +GLOBAL in cu29::prelude - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file diff --git a/cu29/prelude/struct.AlignedBuffer.html b/cu29/prelude/struct.AlignedBuffer.html index 9e31ddc4a..339aeea47 100644 --- a/cu29/prelude/struct.AlignedBuffer.html +++ b/cu29/prelude/struct.AlignedBuffer.html @@ -1,4 +1,4 @@ -AlignedBuffer in cu29::prelude - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E>
where +AlignedBuffer in cu29::prelude - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E>
where E: ElementType,
{ /* private fields */ }
Expand description

A buffer that is aligned to a specific size with the Element of type E.

Implementations§

Source§

impl<E> AlignedBuffer<E>
where E: ElementType,

Source

pub fn new(num_elements: usize, alignment: usize) -> AlignedBuffer<E>

Methods from Deref<Target = [E]>§

Source

pub fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
where @@ -546,7 +546,7 @@
§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);

-

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -563,10 +563,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -577,7 +579,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -593,7 +595,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());

-

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -613,7 +615,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);

-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -631,7 +633,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -654,7 +656,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -677,7 +679,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -698,7 +700,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -710,7 +712,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -727,7 +729,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -754,7 +756,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -772,7 +774,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -790,7 +792,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);
-
Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -809,7 +811,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -824,7 +826,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -840,7 +842,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -860,7 +862,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -879,7 +881,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -902,7 +904,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -927,7 +929,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -952,7 +954,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -979,7 +981,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -994,7 +996,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1023,7 +1025,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1046,7 +1048,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1075,7 +1077,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1097,7 +1099,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1128,7 +1130,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1138,7 +1140,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1159,7 +1161,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1171,7 +1173,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1192,7 +1194,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1205,7 +1207,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1220,7 +1222,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1233,7 +1235,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1249,7 +1251,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1263,7 +1265,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1277,7 +1279,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1291,7 +1293,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1306,7 +1308,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1321,7 +1323,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1336,7 +1338,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1354,7 +1356,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1368,7 +1370,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1423,7 +1425,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1455,7 +1457,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1489,7 +1491,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1518,7 +1520,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1547,7 +1549,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1571,7 +1573,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1617,7 +1619,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1667,7 +1669,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1716,7 +1718,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1731,7 +1733,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1750,7 +1752,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1766,7 +1768,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1786,7 +1788,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1806,13 +1808,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1822,7 +1824,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1859,7 +1861,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1897,7 +1899,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1916,7 +1918,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1948,7 +1950,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1968,7 +1970,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1988,7 +1990,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2029,7 +2031,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2047,7 +2049,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2062,7 +2064,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2076,7 +2078,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2085,7 +2087,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2118,7 +2120,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2155,7 +2157,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2192,7 +2194,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2203,7 +2205,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2215,7 +2217,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2226,7 +2228,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2238,7 +2240,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2279,7 +2281,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2317,7 +2319,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2350,7 +2352,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2376,7 +2378,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2395,7 +2397,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2411,7 +2413,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2424,7 +2426,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2467,7 +2469,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2507,7 +2509,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2541,7 +2543,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2571,7 +2573,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2608,13 +2610,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2625,7 +2627,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2637,13 +2639,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2653,7 +2655,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2662,12 +2664,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29/prelude/struct.Cnx.html b/cu29/prelude/struct.Cnx.html index 43b7eec30..bc0674f60 100644 --- a/cu29/prelude/struct.Cnx.html +++ b/cu29/prelude/struct.Cnx.html @@ -1,4 +1,4 @@ -Cnx in cu29::prelude - Rust

Struct Cnx

Source
pub struct Cnx {
+Cnx in cu29::prelude - Rust

Struct Cnx

Source
pub struct Cnx {
     pub msg: String,
     pub batch: Option<u32>,
     pub store: Option<bool>,
diff --git a/cu29/prelude/struct.ComponentConfig.html b/cu29/prelude/struct.ComponentConfig.html
index 87b8fddb6..e8c3710d6 100644
--- a/cu29/prelude/struct.ComponentConfig.html
+++ b/cu29/prelude/struct.ComponentConfig.html
@@ -1,4 +1,4 @@
-ComponentConfig in cu29::prelude - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w +ComponentConfig in cu29::prelude - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.

Tuple Fields§

§0: HashMap<String, Value>

Implementations§

Source§

impl ComponentConfig

Source

pub fn new() -> ComponentConfig

Source

pub fn get<T>(&self, key: &str) -> Option<T>
where diff --git a/cu29/prelude/struct.CopperContext.html b/cu29/prelude/struct.CopperContext.html index c55ee2a02..c07a71256 100644 --- a/cu29/prelude/struct.CopperContext.html +++ b/cu29/prelude/struct.CopperContext.html @@ -1,4 +1,4 @@ -CopperContext in cu29::prelude - Rust

Struct CopperContext

Source
pub struct CopperContext {
+CopperContext in cu29::prelude - Rust

Struct CopperContext

Source
pub struct CopperContext {
     pub unified_logger: Arc<Mutex<UnifiedLoggerWrite>>,
     pub logger_runtime: LoggerRuntime,
     pub clock: RobotClock,
diff --git a/cu29/prelude/struct.CopperLiskMask.html b/cu29/prelude/struct.CopperLiskMask.html
index e17f3a142..6d704ca91 100644
--- a/cu29/prelude/struct.CopperLiskMask.html
+++ b/cu29/prelude/struct.CopperLiskMask.html
@@ -1,4 +1,4 @@
-CopperLiskMask in cu29::prelude - Rust

Struct CopperLiskMask

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

Not implemented yet. +CopperLiskMask in cu29::prelude - Rust

Struct CopperLiskMask

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

Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for CopperLiskMask

Source§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CopperLiskMask

Source§

fn clone(&self) -> CopperLiskMask

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 Debug for CopperLiskMask

Source§

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

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

impl Decode for CopperLiskMask

Source§

fn decode<__D>(decoder: &mut __D) -> Result<CopperLiskMask, DecodeError>
where diff --git a/cu29/prelude/struct.CopperList.html b/cu29/prelude/struct.CopperList.html index 94cf6dfc2..63955d577 100644 --- a/cu29/prelude/struct.CopperList.html +++ b/cu29/prelude/struct.CopperList.html @@ -1,4 +1,4 @@ -CopperList in cu29::prelude - Rust

Struct CopperList

Source
pub struct CopperList<P>
where +CopperList in cu29::prelude - Rust

Struct CopperList

Source
pub struct CopperList<P>
where P: CopperListTuple,
{ pub id: u32, pub msgs: P, diff --git a/cu29/prelude/struct.CountingAllocator.html b/cu29/prelude/struct.CountingAllocator.html index 13b26cb9a..6eda28e2f 100644 --- a/cu29/prelude/struct.CountingAllocator.html +++ b/cu29/prelude/struct.CountingAllocator.html @@ -1,4 +1,4 @@ -CountingAllocator in cu29::prelude - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

+CountingAllocator in cu29::prelude - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

Implementations§

Trait Implementations§

Source§

impl Default for CountingAllocator

Source§

fn default() -> CountingAllocator

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

impl GlobalAlloc for CountingAllocator

Source§

unsafe fn alloc(&self, layout: Layout) -> *mut u8

Allocates memory as described by the given layout. Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)

Deallocates the block of memory at the given ptr pointer with the given layout. Read more
1.28.0 · Source§

unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more
1.28.0 · Source§

unsafe fn realloc( &self, diff --git a/cu29/prelude/struct.CuArray.html b/cu29/prelude/struct.CuArray.html index 233872ae8..bb8db2282 100644 --- a/cu29/prelude/struct.CuArray.html +++ b/cu29/prelude/struct.CuArray.html @@ -1,4 +1,4 @@ -CuArray in cu29::prelude - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

+CuArray in cu29::prelude - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

Implementations§

Source§

impl<T, const N: usize> CuArray<T, N>

Source

pub fn new() -> CuArray<T, N>

Source

pub fn fill_from_iter<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn capacity(&self) -> usize

Trait Implementations§

Source§

impl<T, const N: usize> Clone for CuArray<T, N>
where T: Clone,

Source§

fn clone(&self) -> CuArray<T, N>

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<T, const N: usize> Debug for CuArray<T, N>
where diff --git a/cu29/prelude/struct.CuCompactString.html b/cu29/prelude/struct.CuCompactString.html index 40e7d71dd..364ee8f00 100644 --- a/cu29/prelude/struct.CuCompactString.html +++ b/cu29/prelude/struct.CuCompactString.html @@ -1,4 +1,4 @@ -CuCompactString in cu29::prelude - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where +CuCompactString in cu29::prelude - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: BorrowDecoder<'de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CuCompactString

Source§

fn clone(&self) -> CuCompactString

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 Debug for CuCompactString

Source§

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

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

impl Decode for CuCompactString

Source§

fn decode<D>(decoder: &mut D) -> Result<CuCompactString, DecodeError>
where D: Decoder,

Attempt to decode this type with the given Decode.
Source§

impl Default for CuCompactString

Source§

fn default() -> CuCompactString

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

impl<'de> Deserialize<'de> for CuCompactString

Source§

fn deserialize<__D>( __deserializer: __D, diff --git a/cu29/prelude/struct.CuConfig.html b/cu29/prelude/struct.CuConfig.html index 60dd432cc..9ed8c1652 100644 --- a/cu29/prelude/struct.CuConfig.html +++ b/cu29/prelude/struct.CuConfig.html @@ -1,4 +1,4 @@ -CuConfig in cu29::prelude - Rust

Struct CuConfig

Source
pub struct CuConfig {
+CuConfig in cu29::prelude - Rust

Struct CuConfig

Source
pub struct CuConfig {
     pub graph: StableGraph<Node, Cnx>,
     pub monitor: Option<MonitorConfig>,
     pub logging: Option<LoggingConfig>,
diff --git a/cu29/prelude/struct.CuDuration.html b/cu29/prelude/struct.CuDuration.html
index d2ba01ede..b57f9bd78 100644
--- a/cu29/prelude/struct.CuDuration.html
+++ b/cu29/prelude/struct.CuDuration.html
@@ -1,4 +1,4 @@
-CuDuration in cu29::prelude - Rust

Struct CuDuration

pub struct CuDuration(pub u64);
Expand description

For Robot times, the underlying type is a u64 representing nanoseconds. +CuDuration in cu29::prelude - Rust

Struct CuDuration

pub struct CuDuration(pub u64);
Expand description

For Robot times, the underlying type is a u64 representing nanoseconds. It is always positive to simplify the reasoning on the user side.

Tuple Fields§

§0: u64

Implementations§

§

impl CuDuration

pub const MIN: CuDuration

pub const MAX: CuDuration

pub fn max(&self, p0: CuDuration) -> CuDuration

pub fn min(&self, p0: CuDuration) -> CuDuration

pub fn as_nanos(&self) -> u64

Trait Implementations§

§

impl Add for CuDuration

§

type Output = CuDuration

The resulting type after applying the + operator.
§

fn add(self, rhs: CuDuration) -> <CuDuration as Add>::Output

Performs the + operation. Read more
§

impl AddAssign for CuDuration

§

fn add_assign(&mut self, rhs: CuDuration)

Performs the += operation. Read more
§

impl<'de> BorrowDecode<'de> for CuDuration

§

fn borrow_decode<D>(decoder: &mut D) -> Result<CuDuration, DecodeError>
where D: BorrowDecoder<'de>,

Attempt to decode this type with the given BorrowDecode.
§

impl Clone for CuDuration

§

fn clone(&self) -> CuDuration

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
§

impl Debug for CuDuration

§

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

Formats the value using the given formatter. Read more
§

impl Decode for CuDuration

§

fn decode<D>(decoder: &mut D) -> Result<CuDuration, DecodeError>
where diff --git a/cu29/prelude/struct.CuDurationStatistics.html b/cu29/prelude/struct.CuDurationStatistics.html index b07107566..07daa5c2a 100644 --- a/cu29/prelude/struct.CuDurationStatistics.html +++ b/cu29/prelude/struct.CuDurationStatistics.html @@ -1,4 +1,4 @@ -CuDurationStatistics in cu29::prelude - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. +CuDurationStatistics in cu29::prelude - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.

Implementations§

Source§

impl CuDurationStatistics

Source

pub fn new(max: CuDuration) -> CuDurationStatistics

Source

pub fn min(&self) -> CuDuration

Source

pub fn max(&self) -> CuDuration

Source

pub fn mean(&self) -> CuDuration

Source

pub fn percentile(&self, percentile: f64) -> CuDuration

Source

pub fn stddev(&self) -> CuDuration

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn jitter_min(&self) -> CuDuration

Source

pub fn jitter_max(&self) -> CuDuration

Source

pub fn jitter_mean(&self) -> CuDuration

Source

pub fn jitter_stddev(&self) -> CuDuration

Source

pub fn jitter_percentile(&self, percentile: f64) -> CuDuration

Source

pub fn record(&mut self, value: CuDuration)

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for CuDurationStatistics

Source§

fn clone(&self) -> CuDurationStatistics

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 Debug for CuDurationStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.CuError.html b/cu29/prelude/struct.CuError.html index 8470133d0..2b4d14973 100644 --- a/cu29/prelude/struct.CuError.html +++ b/cu29/prelude/struct.CuError.html @@ -1,4 +1,4 @@ -CuError in cu29::prelude - Rust

Struct CuError

pub struct CuError { /* private fields */ }
Expand description

Common copper Error type.

+CuError in cu29::prelude - Rust

Struct CuError

pub struct CuError { /* private fields */ }
Expand description

Common copper Error type.

Implementations§

§

impl CuError

pub fn new_with_cause(message: &str, cause: impl Error) -> CuError

pub fn add_cause(self, context: &str) -> CuError

Trait Implementations§

§

impl Clone for CuError

§

fn clone(&self) -> CuError

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
§

impl Debug for CuError

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for CuError

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<CuError, <__D as Deserializer<'de>>::Error>
where diff --git a/cu29/prelude/struct.CuExecutionLoop.html b/cu29/prelude/struct.CuExecutionLoop.html index eeddf92cc..4d9f7efba 100644 --- a/cu29/prelude/struct.CuExecutionLoop.html +++ b/cu29/prelude/struct.CuExecutionLoop.html @@ -1,4 +1,4 @@ -CuExecutionLoop in cu29::prelude - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
+CuExecutionLoop in cu29::prelude - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
     pub steps: Vec<CuExecutionUnit>,
     pub loop_count: Option<u32>,
 }
Expand description

This structure represents a loop in the execution plan. diff --git a/cu29/prelude/struct.CuExecutionStep.html b/cu29/prelude/struct.CuExecutionStep.html index 8ff7355bd..1504aefa7 100644 --- a/cu29/prelude/struct.CuExecutionStep.html +++ b/cu29/prelude/struct.CuExecutionStep.html @@ -1,4 +1,4 @@ -CuExecutionStep in cu29::prelude - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
+CuExecutionStep in cu29::prelude - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
     pub node_id: u32,
     pub node: Node,
     pub task_type: CuTaskType,
diff --git a/cu29/prelude/struct.CuHandle.html b/cu29/prelude/struct.CuHandle.html
index 7a9c9a0e6..666e95cac 100644
--- a/cu29/prelude/struct.CuHandle.html
+++ b/cu29/prelude/struct.CuHandle.html
@@ -1,4 +1,4 @@
-CuHandle in cu29::prelude - Rust

Struct CuHandle

Source
pub struct CuHandle<T>(/* private fields */)
+CuHandle in cu29::prelude - Rust

Struct CuHandle

Source
pub struct CuHandle<T>(/* private fields */)
 where
     T: ArrayLike;
Expand description

A shareable handle to an Array coming from a pool (either host or device).

Implementations§

Source§

impl<T> CuHandle<T>
where diff --git a/cu29/prelude/struct.CuHostMemoryPool.html b/cu29/prelude/struct.CuHostMemoryPool.html index 751456ecd..4c6614e6b 100644 --- a/cu29/prelude/struct.CuHostMemoryPool.html +++ b/cu29/prelude/struct.CuHostMemoryPool.html @@ -1,4 +1,4 @@ -CuHostMemoryPool in cu29::prelude - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

+CuHostMemoryPool in cu29::prelude - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

Implementations§

Source§

impl<T> CuHostMemoryPool<T>
where T: ArrayLike + 'static,

Source

pub fn new<F>( id: &str, diff --git a/cu29/prelude/struct.CuListsManager.html b/cu29/prelude/struct.CuListsManager.html index 81c2d8166..b36a37c33 100644 --- a/cu29/prelude/struct.CuListsManager.html +++ b/cu29/prelude/struct.CuListsManager.html @@ -1,4 +1,4 @@ -CuListsManager in cu29::prelude - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where +CuListsManager in cu29::prelude - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P, const N: usize>
where P: CopperListTuple,
{ /* private fields */ }
Expand description

This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.

diff --git a/cu29/prelude/struct.CuLogEntry.html b/cu29/prelude/struct.CuLogEntry.html index 4d9c0fa05..0cfc78305 100644 --- a/cu29/prelude/struct.CuLogEntry.html +++ b/cu29/prelude/struct.CuLogEntry.html @@ -1,4 +1,4 @@ -CuLogEntry in cu29::prelude - Rust

Struct CuLogEntry

pub struct CuLogEntry {
+CuLogEntry in cu29::prelude - Rust

Struct CuLogEntry

pub struct CuLogEntry {
     pub time: CuDuration,
     pub msg_index: u32,
     pub paramname_indexes: SmallVec<[u32; 10]>,
diff --git a/cu29/prelude/struct.CuMsg.html b/cu29/prelude/struct.CuMsg.html
index 1b4eb431a..fc620577d 100644
--- a/cu29/prelude/struct.CuMsg.html
+++ b/cu29/prelude/struct.CuMsg.html
@@ -1,4 +1,4 @@
-CuMsg in cu29::prelude - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where +CuMsg in cu29::prelude - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where T: CuMsgPayload,
{ pub metadata: CuMsgMetadata, /* private fields */ diff --git a/cu29/prelude/struct.CuMsgMetadata.html b/cu29/prelude/struct.CuMsgMetadata.html index bd5c5d291..748514a0e 100644 --- a/cu29/prelude/struct.CuMsgMetadata.html +++ b/cu29/prelude/struct.CuMsgMetadata.html @@ -1,4 +1,4 @@ -CuMsgMetadata in cu29::prelude - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
+CuMsgMetadata in cu29::prelude - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
     pub process_time: PartialCuTimeRange,
     pub tov: Tov,
     pub status_txt: CuCompactString,
diff --git a/cu29/prelude/struct.CuRuntime.html b/cu29/prelude/struct.CuRuntime.html
index e16a07bb6..a395758ff 100644
--- a/cu29/prelude/struct.CuRuntime.html
+++ b/cu29/prelude/struct.CuRuntime.html
@@ -1,4 +1,4 @@
-CuRuntime in cu29::prelude - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>
where +CuRuntime in cu29::prelude - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P, M, const NBCL: usize>{
     pub tasks: CT,
diff --git a/cu29/prelude/struct.CuSimSinkTask.html b/cu29/prelude/struct.CuSimSinkTask.html
index 0239105df..2c36c1874 100644
--- a/cu29/prelude/struct.CuSimSinkTask.html
+++ b/cu29/prelude/struct.CuSimSinkTask.html
@@ -1,4 +1,4 @@
-CuSimSinkTask in cu29::prelude - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. +CuSimSinkTask in cu29::prelude - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSinkTask<'cl> for CuSimSinkTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Input = &'cl CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSinkTask<T>, CuError>
where diff --git a/cu29/prelude/struct.CuSimSrcTask.html b/cu29/prelude/struct.CuSimSrcTask.html index dff3c3131..e85473580 100644 --- a/cu29/prelude/struct.CuSimSrcTask.html +++ b/cu29/prelude/struct.CuSimSrcTask.html @@ -1,4 +1,4 @@ -CuSimSrcTask in cu29::prelude - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. +CuSimSrcTask in cu29::prelude - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSrcTask<'cl> for CuSimSrcTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Output = &'cl mut CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSrcTask<T>, CuError>
where diff --git a/cu29/prelude/struct.CuTimeRange.html b/cu29/prelude/struct.CuTimeRange.html index 2bdb5966f..4bcf7a24d 100644 --- a/cu29/prelude/struct.CuTimeRange.html +++ b/cu29/prelude/struct.CuTimeRange.html @@ -1,4 +1,4 @@ -CuTimeRange in cu29::prelude - Rust

Struct CuTimeRange

pub struct CuTimeRange {
+CuTimeRange in cu29::prelude - Rust

Struct CuTimeRange

pub struct CuTimeRange {
     pub start: CuDuration,
     pub end: CuDuration,
 }
Expand description

Represents a time range.

diff --git a/cu29/prelude/struct.Instant.html b/cu29/prelude/struct.Instant.html index 9069f11c8..fb2d81189 100644 --- a/cu29/prelude/struct.Instant.html +++ b/cu29/prelude/struct.Instant.html @@ -1,4 +1,4 @@ -Instant in cu29::prelude - Rust

Struct Instant

pub struct Instant(/* private fields */);
Expand description

A point-in-time wall-clock measurement.

+Instant in cu29::prelude - Rust

Struct Instant

pub struct Instant(/* private fields */);
Expand description

A point-in-time wall-clock measurement.

Mimics most of the functionality of std::time::Instant but provides an additional method for using the “recent time” feature of quanta.

§Monotonicity

diff --git a/cu29/prelude/struct.LiveStatistics.html b/cu29/prelude/struct.LiveStatistics.html index e43f9cd69..490b30b45 100644 --- a/cu29/prelude/struct.LiveStatistics.html +++ b/cu29/prelude/struct.LiveStatistics.html @@ -1,4 +1,4 @@ -LiveStatistics in cu29::prelude - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

+LiveStatistics in cu29::prelude - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

Implementations§

Source§

impl LiveStatistics

Source

pub fn new_unbounded() -> LiveStatistics

Source

pub fn new_with_max(max: u64) -> LiveStatistics

Source

pub fn min(&self) -> u64

Source

pub fn max(&self) -> u64

Source

pub fn mean(&self) -> f64

Source

pub fn percentile(&self, percentile: f64) -> u64

Source

pub fn record(&mut self, value: u64)

Adds a value to the statistics.

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for LiveStatistics

Source§

fn clone(&self) -> LiveStatistics

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 Debug for LiveStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.LoggerRuntime.html b/cu29/prelude/struct.LoggerRuntime.html index 6a3c4d812..5eb96972c 100644 --- a/cu29/prelude/struct.LoggerRuntime.html +++ b/cu29/prelude/struct.LoggerRuntime.html @@ -1,4 +1,4 @@ -LoggerRuntime in cu29::prelude - Rust

Struct LoggerRuntime

pub struct LoggerRuntime {}
Expand description

The lifetime of this struct is the lifetime of the logger.

+LoggerRuntime in cu29::prelude - Rust

Struct LoggerRuntime

pub struct LoggerRuntime {}
Expand description

The lifetime of this struct is the lifetime of the logger.

Implementations§

§

impl LoggerRuntime

pub fn init( clock: RobotClock, destination: impl WriteStream<CuLogEntry> + 'static, diff --git a/cu29/prelude/struct.LoggingConfig.html b/cu29/prelude/struct.LoggingConfig.html index 302c34807..870b87706 100644 --- a/cu29/prelude/struct.LoggingConfig.html +++ b/cu29/prelude/struct.LoggingConfig.html @@ -1,4 +1,4 @@ -LoggingConfig in cu29::prelude - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
+LoggingConfig in cu29::prelude - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
     pub slab_size_mib: Option<u64>,
     pub section_size_mib: Option<u64>,
     pub enable_task_logging: bool,
diff --git a/cu29/prelude/struct.MonitorConfig.html b/cu29/prelude/struct.MonitorConfig.html
index d20f6fd34..f8be2110a 100644
--- a/cu29/prelude/struct.MonitorConfig.html
+++ b/cu29/prelude/struct.MonitorConfig.html
@@ -1,4 +1,4 @@
-MonitorConfig in cu29::prelude - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( +MonitorConfig in cu29::prelude - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MonitorConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MonitorConfig

Source§

fn serialize<__S>( diff --git a/cu29/prelude/struct.NoMonitor.html b/cu29/prelude/struct.NoMonitor.html index 581779cf6..e0ae1479e 100644 --- a/cu29/prelude/struct.NoMonitor.html +++ b/cu29/prelude/struct.NoMonitor.html @@ -1,4 +1,4 @@ -NoMonitor in cu29::prelude - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. +NoMonitor in cu29::prelude - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.

Trait Implementations§

Source§

impl CuMonitor for NoMonitor

Source§

fn new( _config: &CuConfig, diff --git a/cu29/prelude/struct.Node.html b/cu29/prelude/struct.Node.html index d0cfbdae2..e4e5d3271 100644 --- a/cu29/prelude/struct.Node.html +++ b/cu29/prelude/struct.Node.html @@ -1,4 +1,4 @@ -Node in cu29::prelude - Rust

Struct Node

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

A node in the configuration graph. +Node in cu29::prelude - Rust

Struct Node

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

A node in the configuration graph. A node represents a Task in the system Graph.

Implementations§

Source§

impl Node

Source

pub fn new(id: &str, ptype: &str) -> Node

Source

pub fn get_id(&self) -> String

Source

pub fn set_type(self, name: Option<String>) -> Node

Source

pub fn get_type(&self) -> &str

Source

pub fn get_instance_config(&self) -> Option<&ComponentConfig>

Source

pub fn get_param<T>(&self, key: &str) -> Option<T>
where T: From<Value>,

Source

pub fn set_param<T>(&mut self, key: &str, value: T)
where diff --git a/cu29/prelude/struct.NullLog.html b/cu29/prelude/struct.NullLog.html index 48f9a038f..9ccddaf35 100644 --- a/cu29/prelude/struct.NullLog.html +++ b/cu29/prelude/struct.NullLog.html @@ -1,4 +1,4 @@ -NullLog in cu29::prelude - Rust

Struct NullLog

pub struct NullLog;

Trait Implementations§

§

impl Log for NullLog

§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be +NullLog in cu29::prelude - Rust

Struct NullLog

pub struct NullLog;

Trait Implementations§

§

impl Log for NullLog

§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
§

fn log(&self, _record: &Record<'_>)

Logs the Record. Read more
§

fn flush(&self)

Flushes any buffered records. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.OptionCuTime.html b/cu29/prelude/struct.OptionCuTime.html index cabf35dc6..c4b84fb21 100644 --- a/cu29/prelude/struct.OptionCuTime.html +++ b/cu29/prelude/struct.OptionCuTime.html @@ -1,4 +1,4 @@ -OptionCuTime in cu29::prelude - Rust

Struct OptionCuTime

pub struct OptionCuTime(/* private fields */);
Expand description

Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.

+OptionCuTime in cu29::prelude - Rust

Struct OptionCuTime

pub struct OptionCuTime(/* private fields */);
Expand description

Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.

Implementations§

§

impl OptionCuTime

pub fn is_none(&self) -> bool

pub fn none() -> OptionCuTime

pub fn unwrap(self) -> CuDuration

Trait Implementations§

§

impl<'__de> BorrowDecode<'__de> for OptionCuTime

§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<OptionCuTime, DecodeError>
where __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
§

impl Clone for OptionCuTime

§

fn clone(&self) -> OptionCuTime

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
§

impl Debug for OptionCuTime

§

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

Formats the value using the given formatter. Read more
§

impl Decode for OptionCuTime

§

fn decode<__D>(decoder: &mut __D) -> Result<OptionCuTime, DecodeError>
where __D: Decoder,

Attempt to decode this type with the given Decode.
§

impl Default for OptionCuTime

§

fn default() -> OptionCuTime

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

impl<'de> Deserialize<'de> for OptionCuTime

§

fn deserialize<__D>( diff --git a/cu29/prelude/struct.OwningIoWriter.html b/cu29/prelude/struct.OwningIoWriter.html index a30a112ce..e30df4309 100644 --- a/cu29/prelude/struct.OwningIoWriter.html +++ b/cu29/prelude/struct.OwningIoWriter.html @@ -1,4 +1,4 @@ -OwningIoWriter in cu29::prelude - Rust

Struct OwningIoWriter

pub struct OwningIoWriter<W>
where +OwningIoWriter in cu29::prelude - Rust

Struct OwningIoWriter

pub struct OwningIoWriter<W>
where W: Write,
{ /* private fields */ }

Implementations§

§

impl<W> OwningIoWriter<W>
where W: Write,

pub fn new(writer: W) -> OwningIoWriter<W>

pub fn bytes_written(&self) -> usize

pub fn flush(&mut self) -> Result<(), EncodeError>

Trait Implementations§

§

impl<W> Writer for OwningIoWriter<W>
where W: Write,

§

fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>

Write bytes to the underlying writer. Exactly bytes.len() bytes must be written, or else an error should be returned.

Auto Trait Implementations§

§

impl<W> Freeze for OwningIoWriter<W>
where diff --git a/cu29/prelude/struct.PartialCuTimeRange.html b/cu29/prelude/struct.PartialCuTimeRange.html index a972e6f14..4b3e124ed 100644 --- a/cu29/prelude/struct.PartialCuTimeRange.html +++ b/cu29/prelude/struct.PartialCuTimeRange.html @@ -1,4 +1,4 @@ -PartialCuTimeRange in cu29::prelude - Rust

Struct PartialCuTimeRange

pub struct PartialCuTimeRange {
+PartialCuTimeRange in cu29::prelude - Rust

Struct PartialCuTimeRange

pub struct PartialCuTimeRange {
     pub start: OptionCuTime,
     pub end: OptionCuTime,
 }
Expand description

Represents a time range with possible undefined start or end or both.

diff --git a/cu29/prelude/struct.RobotClock.html b/cu29/prelude/struct.RobotClock.html index b7d6c5a92..8abe85698 100644 --- a/cu29/prelude/struct.RobotClock.html +++ b/cu29/prelude/struct.RobotClock.html @@ -1,4 +1,4 @@ -RobotClock in cu29::prelude - Rust

Struct RobotClock

pub struct RobotClock { /* private fields */ }
Expand description

A running Robot clock. +RobotClock in cu29::prelude - Rust

Struct RobotClock

pub struct RobotClock { /* private fields */ }
Expand description

A running Robot clock. The clock is a monotonic clock that starts at an arbitrary reference time. It is clone resilient, ie a clone will be the same clock, even when mocked.

Implementations§

§

impl RobotClock

pub fn new() -> RobotClock

Creates a RobotClock using now as its reference time. diff --git a/cu29/prelude/struct.RobotClockMock.html b/cu29/prelude/struct.RobotClockMock.html index 197c29bbe..741023699 100644 --- a/cu29/prelude/struct.RobotClockMock.html +++ b/cu29/prelude/struct.RobotClockMock.html @@ -1,4 +1,4 @@ -RobotClockMock in cu29::prelude - Rust

Struct RobotClockMock

pub struct RobotClockMock(/* private fields */);
Expand description

A mock clock that can be controlled by the user.

+RobotClockMock in cu29::prelude - Rust

Struct RobotClockMock

pub struct RobotClockMock(/* private fields */);
Expand description

A mock clock that can be controlled by the user.

Implementations§

§

impl RobotClockMock

pub fn increment(&self, amount: Duration)

pub fn decrement(&self, amount: Duration)

Decrements the time by the given amount. Be careful this brakes the monotonicity of the clock.

pub fn value(&self) -> u64

Gets the current value of time.

diff --git a/cu29/prelude/struct.ScopedAllocCounter.html b/cu29/prelude/struct.ScopedAllocCounter.html index c506891f6..87363cfce 100644 --- a/cu29/prelude/struct.ScopedAllocCounter.html +++ b/cu29/prelude/struct.ScopedAllocCounter.html @@ -1,4 +1,4 @@ -ScopedAllocCounter in cu29::prelude - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

+ScopedAllocCounter in cu29::prelude - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

Implementations§

Source§

impl ScopedAllocCounter

Source

pub fn new() -> ScopedAllocCounter

Source

pub fn get_allocated(&self) -> usize

Returns the total number of bytes allocated in the current scope since the creation of this ScopedAllocCounter.

§Example
diff --git a/cu29/prelude/struct.SectionHandle.html b/cu29/prelude/struct.SectionHandle.html index ced472f0a..b9932e7ad 100644 --- a/cu29/prelude/struct.SectionHandle.html +++ b/cu29/prelude/struct.SectionHandle.html @@ -1,9 +1,9 @@ -SectionHandle in cu29::prelude - Rust

Struct SectionHandle

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

A SectionHandle is a handle to a section in the datalogger. +SectionHandle in cu29::prelude - Rust

Struct SectionHandle

pub struct SectionHandle { /* private fields */ }
Expand description

A SectionHandle is a handle to a section in the datalogger. It allows to track the lifecycle of a section of the datalogger.

-

Implementations§

Source§

impl SectionHandle

Source

pub fn create( +

Implementations§

§

impl SectionHandle

pub fn create( section_header: SectionHeader, buffer: &'static mut [u8], -) -> SectionHandle

Source

pub fn get_user_buffer(&mut self) -> &mut [u8]

Source

pub fn update_header(&mut self)

Trait Implementations§

Source§

impl Default for SectionHandle

Source§

fn default() -> SectionHandle

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +) -> SectionHandle

pub fn get_user_buffer(&mut self) -> &mut [u8]

pub fn update_header(&mut self)

Trait Implementations§

§

impl Default for SectionHandle

§

fn default() -> SectionHandle

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

Auto Trait Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/cu29/prelude/struct.SectionHeader.html b/cu29/prelude/struct.SectionHeader.html index c65861baa..2d05c014b 100644 --- a/cu29/prelude/struct.SectionHeader.html +++ b/cu29/prelude/struct.SectionHeader.html @@ -1,9 +1,9 @@ -SectionHeader in cu29::prelude - Rust

Struct SectionHeader

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

Each concurrent sublogger is tracked through a section header. +SectionHeader in cu29::prelude - Rust

Struct SectionHeader

pub struct SectionHeader { /* private fields */ }
Expand description

Each concurrent sublogger is tracked through a section header. They form a linked list of sections. The entry type is used to identify the type of data in the section.

-

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for SectionHeader

Source§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<SectionHeader, DecodeError>
where - __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
Source§

impl Debug for SectionHeader

Source§

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

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

impl Decode for SectionHeader

Source§

fn decode<__D>(decoder: &mut __D) -> Result<SectionHeader, DecodeError>
where - __D: Decoder,

Attempt to decode this type with the given Decode.
Source§

impl Default for SectionHeader

Source§

fn default() -> SectionHeader

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

impl Encode for SectionHeader

Source§

fn encode<__E>(&self, encoder: &mut __E) -> Result<(), EncodeError>
where +

Trait Implementations§

§

impl<'__de> BorrowDecode<'__de> for SectionHeader

§

fn borrow_decode<__D>(decoder: &mut __D) -> Result<SectionHeader, DecodeError>
where + __D: BorrowDecoder<'__de>,

Attempt to decode this type with the given BorrowDecode.
§

impl Debug for SectionHeader

§

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

Formats the value using the given formatter. Read more
§

impl Decode for SectionHeader

§

fn decode<__D>(decoder: &mut __D) -> Result<SectionHeader, DecodeError>
where + __D: Decoder,

Attempt to decode this type with the given Decode.
§

impl Default for SectionHeader

§

fn default() -> SectionHeader

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

impl Encode for SectionHeader

§

fn encode<__E>(&self, encoder: &mut __E) -> Result<(), EncodeError>
where __E: Encoder,

Encode a given type.

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.SimpleFileWriter.html b/cu29/prelude/struct.SimpleFileWriter.html index 7501c2cd2..50e82f6cc 100644 --- a/cu29/prelude/struct.SimpleFileWriter.html +++ b/cu29/prelude/struct.SimpleFileWriter.html @@ -1,4 +1,4 @@ -SimpleFileWriter in cu29::prelude - Rust

Struct SimpleFileWriter

pub struct SimpleFileWriter { /* private fields */ }
Expand description

This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

+SimpleFileWriter in cu29::prelude - Rust

Struct SimpleFileWriter

pub struct SimpleFileWriter { /* private fields */ }
Expand description

This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

Implementations§

Trait Implementations§

§

impl Debug for SimpleFileWriter

§

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

Formats the value using the given formatter. Read more
§

impl WriteStream<CuLogEntry> for SimpleFileWriter

§

fn log(&mut self, obj: &CuLogEntry) -> Result<(), CuError>

§

fn flush(&mut self) -> Result<(), CuError>

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.UnifiedLoggerBuilder.html b/cu29/prelude/struct.UnifiedLoggerBuilder.html index 0001cf06e..e8555432a 100644 --- a/cu29/prelude/struct.UnifiedLoggerBuilder.html +++ b/cu29/prelude/struct.UnifiedLoggerBuilder.html @@ -1,6 +1,6 @@ -UnifiedLoggerBuilder in cu29::prelude - Rust

Struct UnifiedLoggerBuilder

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

Use this builder to create a new DataLogger.

-

Implementations§

Source§

impl UnifiedLoggerBuilder

Source

pub fn new() -> UnifiedLoggerBuilder

Source

pub fn file_base_name(self, file_path: &Path) -> UnifiedLoggerBuilder

If “something/toto.copper” is given, it will find or create “something/toto_0.copper”, “something/toto_1.copper” etc.

-
Source

pub fn preallocated_size(self, preallocated_size: usize) -> UnifiedLoggerBuilder

Source

pub fn write(self, write: bool) -> UnifiedLoggerBuilder

Source

pub fn create(self, create: bool) -> UnifiedLoggerBuilder

Source

pub fn build(self) -> Result<UnifiedLogger, Error>

Trait Implementations§

Source§

impl Default for UnifiedLoggerBuilder

Source§

fn default() -> UnifiedLoggerBuilder

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +UnifiedLoggerBuilder in cu29::prelude - Rust

Struct UnifiedLoggerBuilder

pub struct UnifiedLoggerBuilder { /* private fields */ }
Expand description

Use this builder to create a new DataLogger.

+

Implementations§

§

impl UnifiedLoggerBuilder

pub fn new() -> UnifiedLoggerBuilder

pub fn file_base_name(self, file_path: &Path) -> UnifiedLoggerBuilder

If “something/toto.copper” is given, it will find or create “something/toto_0.copper”, “something/toto_1.copper” etc.

+

pub fn preallocated_size(self, preallocated_size: usize) -> UnifiedLoggerBuilder

pub fn write(self, write: bool) -> UnifiedLoggerBuilder

pub fn create(self, create: bool) -> UnifiedLoggerBuilder

pub fn build(self) -> Result<UnifiedLogger, Error>

Trait Implementations§

§

impl Default for UnifiedLoggerBuilder

§

fn default() -> UnifiedLoggerBuilder

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

Auto Trait Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/cu29/prelude/struct.UnifiedLoggerIOReader.html b/cu29/prelude/struct.UnifiedLoggerIOReader.html index 3b4f895d6..58673e642 100644 --- a/cu29/prelude/struct.UnifiedLoggerIOReader.html +++ b/cu29/prelude/struct.UnifiedLoggerIOReader.html @@ -1,14 +1,14 @@ -UnifiedLoggerIOReader in cu29::prelude - Rust

Struct UnifiedLoggerIOReader

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

This a convenience wrapper around the UnifiedLoggerRead to implement the Read trait.

-

Implementations§

Source§

impl UnifiedLoggerIOReader

Source

pub fn new( +UnifiedLoggerIOReader in cu29::prelude - Rust

Struct UnifiedLoggerIOReader

pub struct UnifiedLoggerIOReader { /* private fields */ }
Expand description

This a convenience wrapper around the UnifiedLoggerRead to implement the Read trait.

+

Implementations§

Trait Implementations§

Source§

impl Read for UnifiedLoggerIOReader

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning -how many bytes were read. Read more
1.36.0 · Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored -implementation. Read more
1.0.0 · Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where - Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where - Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>

Trait Implementations§

§

impl Read for UnifiedLoggerIOReader

§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning +how many bytes were read. Read more
1.36.0 · Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored +implementation. Read more
1.0.0 · Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where + Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where R: Read, - Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where + Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.UnifiedLoggerRead.html b/cu29/prelude/struct.UnifiedLoggerRead.html index a70880b7c..9345005f8 100644 --- a/cu29/prelude/struct.UnifiedLoggerRead.html +++ b/cu29/prelude/struct.UnifiedLoggerRead.html @@ -1,8 +1,8 @@ -UnifiedLoggerRead in cu29::prelude - Rust

Struct UnifiedLoggerRead

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

A read side of the datalogger.

-

Implementations§

Source§

impl UnifiedLoggerRead

Source

pub fn new(base_file_path: &Path) -> Result<UnifiedLoggerRead, Error>

Source

pub fn read_next_section_type( +UnifiedLoggerRead in cu29::prelude - Rust

Struct UnifiedLoggerRead

pub struct UnifiedLoggerRead { /* private fields */ }
Expand description

A read side of the datalogger.

+

Implementations§

§

impl UnifiedLoggerRead

pub fn new(base_file_path: &Path) -> Result<UnifiedLoggerRead, Error>

pub fn read_next_section_type( &mut self, datalogtype: UnifiedLogType, -) -> Result<Option<Vec<u8>>, CuError>

Source

pub fn read_section(&mut self) -> Result<Vec<u8>, CuError>

Reads the section from the section header pos.

+) -> Result<Option<Vec<u8>>, CuError>

pub fn read_section(&mut self) -> Result<Vec<u8>, CuError>

Reads the section from the section header pos.

Auto Trait Implementations§

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 diff --git a/cu29/prelude/struct.UnifiedLoggerWrite.html b/cu29/prelude/struct.UnifiedLoggerWrite.html index b389e193c..99289758f 100644 --- a/cu29/prelude/struct.UnifiedLoggerWrite.html +++ b/cu29/prelude/struct.UnifiedLoggerWrite.html @@ -1,5 +1,5 @@ -UnifiedLoggerWrite in cu29::prelude - Rust

Struct UnifiedLoggerWrite

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

A write side of the datalogger.

-

Implementations§

Source§

impl UnifiedLoggerWrite

Source

pub fn flush_section(&mut self, section: &mut SectionHandle)

Source

pub fn stats(&self) -> (usize, Vec<usize>, usize)

Trait Implementations§

Source§

impl Drop for UnifiedLoggerWrite

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +UnifiedLoggerWrite in cu29::prelude - Rust

Struct UnifiedLoggerWrite

pub struct UnifiedLoggerWrite { /* private fields */ }
Expand description

A write side of the datalogger.

+

Implementations§

§

impl UnifiedLoggerWrite

pub fn flush_section(&mut self, section: &mut SectionHandle)

pub fn stats(&self) -> (usize, Vec<usize>, usize)

Trait Implementations§

§

impl Drop for UnifiedLoggerWrite

§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/cu29/prelude/trait.ArrayLike.html b/cu29/prelude/trait.ArrayLike.html index a9366359b..d915201cc 100644 --- a/cu29/prelude/trait.ArrayLike.html +++ b/cu29/prelude/trait.ArrayLike.html @@ -1,4 +1,4 @@ -ArrayLike in cu29::prelude - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
+ArrayLike in cu29::prelude - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
     Deref<Target = [Self::Element]>
     + DerefMut
     + Debug
diff --git a/cu29/prelude/trait.ClockProvider.html b/cu29/prelude/trait.ClockProvider.html
index 305b69a5c..159c28280 100644
--- a/cu29/prelude/trait.ClockProvider.html
+++ b/cu29/prelude/trait.ClockProvider.html
@@ -1,4 +1,4 @@
-ClockProvider in cu29::prelude - Rust

Trait ClockProvider

pub trait ClockProvider {
+ClockProvider in cu29::prelude - Rust

Trait ClockProvider

pub trait ClockProvider {
     // Required method
     fn get_clock(&self) -> RobotClock;
 }
Expand description

A trait to provide a clock to the runtime.

diff --git a/cu29/prelude/trait.CopperListTuple.html b/cu29/prelude/trait.CopperListTuple.html index e06e50fa5..27021cb08 100644 --- a/cu29/prelude/trait.CopperListTuple.html +++ b/cu29/prelude/trait.CopperListTuple.html @@ -1,4 +1,4 @@ -CopperListTuple in cu29::prelude - Rust

Trait CopperListTuple

pub trait CopperListTuple:
+CopperListTuple in cu29::prelude - Rust

Trait CopperListTuple

pub trait CopperListTuple:
     Sized
     + Encode
     + Decode
diff --git a/cu29/prelude/trait.CuMonitor.html b/cu29/prelude/trait.CuMonitor.html
index 635576e30..f9dbf7454 100644
--- a/cu29/prelude/trait.CuMonitor.html
+++ b/cu29/prelude/trait.CuMonitor.html
@@ -1,4 +1,4 @@
-CuMonitor in cu29::prelude - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
+CuMonitor in cu29::prelude - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
     // Required methods
     fn new(
         config: &CuConfig,
diff --git a/cu29/prelude/trait.CuMsgPack.html b/cu29/prelude/trait.CuMsgPack.html
index a7d650953..304ca7799 100644
--- a/cu29/prelude/trait.CuMsgPack.html
+++ b/cu29/prelude/trait.CuMsgPack.html
@@ -1,4 +1,4 @@
-CuMsgPack in cu29::prelude - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where +CuMsgPack in cu29::prelude - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1, T2> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)
where T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl,

Source§

impl<'cl, T1, T2, T3> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>)
where T1: CuMsgPayload + 'cl, diff --git a/cu29/prelude/trait.CuMsgPayload.html b/cu29/prelude/trait.CuMsgPayload.html index 43ccd0509..f2b038415 100644 --- a/cu29/prelude/trait.CuMsgPayload.html +++ b/cu29/prelude/trait.CuMsgPayload.html @@ -1,4 +1,4 @@ -CuMsgPayload in cu29::prelude - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
+CuMsgPayload in cu29::prelude - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
     Sized
     + Default
     + Debug
diff --git a/cu29/prelude/trait.CuPool.html b/cu29/prelude/trait.CuPool.html
index b1d6db5ed..85f3390f2 100644
--- a/cu29/prelude/trait.CuPool.html
+++ b/cu29/prelude/trait.CuPool.html
@@ -1,4 +1,4 @@
-CuPool in cu29::prelude - Rust

Trait CuPool

Source
pub trait CuPool<T>: PoolMonitor
where +CuPool in cu29::prelude - Rust

Trait CuPool

Source
pub trait CuPool<T>: PoolMonitor
where T: ArrayLike,
{ // Required methods fn acquire(&self) -> Option<CuHandle<T>>; diff --git a/cu29/prelude/trait.CuSinkTask.html b/cu29/prelude/trait.CuSinkTask.html index 6189fc638..1b5679638 100644 --- a/cu29/prelude/trait.CuSinkTask.html +++ b/cu29/prelude/trait.CuSinkTask.html @@ -1,4 +1,4 @@ -CuSinkTask in cu29::prelude - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
+CuSinkTask in cu29::prelude - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/prelude/trait.CuSrcTask.html b/cu29/prelude/trait.CuSrcTask.html
index a9f7170fd..56f39d436 100644
--- a/cu29/prelude/trait.CuSrcTask.html
+++ b/cu29/prelude/trait.CuSrcTask.html
@@ -1,4 +1,4 @@
-CuSrcTask in cu29::prelude - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
+CuSrcTask in cu29::prelude - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
     type Output: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29/prelude/trait.CuTask.html b/cu29/prelude/trait.CuTask.html
index e3b4db62c..46f50af60 100644
--- a/cu29/prelude/trait.CuTask.html
+++ b/cu29/prelude/trait.CuTask.html
@@ -1,4 +1,4 @@
-CuTask in cu29::prelude - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
+CuTask in cu29::prelude - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
     type Output: CuMsgPack<'cl>;
 
diff --git a/cu29/prelude/trait.DeviceCuPool.html b/cu29/prelude/trait.DeviceCuPool.html
index ebaa54027..b0e32184c 100644
--- a/cu29/prelude/trait.DeviceCuPool.html
+++ b/cu29/prelude/trait.DeviceCuPool.html
@@ -1,4 +1,4 @@
-DeviceCuPool in cu29::prelude - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T>: CuPool<T>
where +DeviceCuPool in cu29::prelude - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T>: CuPool<T>
where T: ArrayLike,
{ // Required method fn copy_to_host_pool<O>( diff --git a/cu29/prelude/trait.ElementType.html b/cu29/prelude/trait.ElementType.html index 2308c3e95..f89b3bdb8 100644 --- a/cu29/prelude/trait.ElementType.html +++ b/cu29/prelude/trait.ElementType.html @@ -1,4 +1,4 @@ -ElementType in cu29::prelude - Rust

Trait ElementType

Source
pub trait ElementType:
+ElementType in cu29::prelude - Rust

Trait ElementType

Source
pub trait ElementType:
     Sized
     + Default
     + Copy
diff --git a/cu29/prelude/trait.Freezable.html b/cu29/prelude/trait.Freezable.html
index 8a67915ad..ef4ab3e75 100644
--- a/cu29/prelude/trait.Freezable.html
+++ b/cu29/prelude/trait.Freezable.html
@@ -1,4 +1,4 @@
-Freezable in cu29::prelude - Rust

Trait Freezable

Source
pub trait Freezable {
+Freezable in cu29::prelude - Rust

Trait Freezable

Source
pub trait Freezable {
     // Provided methods
     fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
        where E: Encoder { ... }
diff --git a/cu29/prelude/trait.PoolMonitor.html b/cu29/prelude/trait.PoolMonitor.html
index 8086fc423..18798b818 100644
--- a/cu29/prelude/trait.PoolMonitor.html
+++ b/cu29/prelude/trait.PoolMonitor.html
@@ -1,4 +1,4 @@
-PoolMonitor in cu29::prelude - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
+PoolMonitor in cu29::prelude - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
     // Required methods
     fn id(&self) -> ArrayString<64>;
     fn space_left(&self) -> usize;
diff --git a/cu29/prelude/trait.WriteStream.html b/cu29/prelude/trait.WriteStream.html
index a95043fb0..6a8e7b2e5 100644
--- a/cu29/prelude/trait.WriteStream.html
+++ b/cu29/prelude/trait.WriteStream.html
@@ -1,4 +1,4 @@
-WriteStream in cu29::prelude - Rust

Trait WriteStream

pub trait WriteStream<E>:
+WriteStream in cu29::prelude - Rust

Trait WriteStream

pub trait WriteStream<E>:
     Sync
     + Send
     + Debug
where diff --git a/cu29/prelude/type.AscIter.html b/cu29/prelude/type.AscIter.html index 5816ebdde..6a5db4dd1 100644 --- a/cu29/prelude/type.AscIter.html +++ b/cu29/prelude/type.AscIter.html @@ -1 +1 @@ -AscIter in cu29::prelude - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file +AscIter in cu29::prelude - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/type.AscIterMut.html b/cu29/prelude/type.AscIterMut.html index 840c2a626..65ef8d138 100644 --- a/cu29/prelude/type.AscIterMut.html +++ b/cu29/prelude/type.AscIterMut.html @@ -1 +1 @@ -AscIterMut in cu29::prelude - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file +AscIterMut in cu29::prelude - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/type.CuResult.html b/cu29/prelude/type.CuResult.html index 583cd1981..22f359b0f 100644 --- a/cu29/prelude/type.CuResult.html +++ b/cu29/prelude/type.CuResult.html @@ -1,4 +1,4 @@ -CuResult in cu29::prelude - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
+CuResult in cu29::prelude - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
     Ok(T),
     Err(CuError),
 }

Variants§

§1.0.0

Ok(T)

Contains the success value

diff --git a/cu29/prelude/type.CuTime.html b/cu29/prelude/type.CuTime.html index 79e67f35f..fd1d3e1ca 100644 --- a/cu29/prelude/type.CuTime.html +++ b/cu29/prelude/type.CuTime.html @@ -1,2 +1,2 @@ -CuTime in cu29::prelude - Rust

Type Alias CuTime

pub type CuTime = CuDuration;
Expand description

A robot time is just a duration from a fixed point in time.

+CuTime in cu29::prelude - Rust

Type Alias CuTime

pub type CuTime = CuDuration;
Expand description

A robot time is just a duration from a fixed point in time.

Aliased Type§

struct CuTime(pub u64);

Fields§

§0: u64
\ No newline at end of file diff --git a/cu29/prelude/type.Iter.html b/cu29/prelude/type.Iter.html index b9efb9c9e..968e815f0 100644 --- a/cu29/prelude/type.Iter.html +++ b/cu29/prelude/type.Iter.html @@ -1 +1 @@ -Iter in cu29::prelude - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file +Iter in cu29::prelude - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/type.IterMut.html b/cu29/prelude/type.IterMut.html index ad059f93b..2f84d5a13 100644 --- a/cu29/prelude/type.IterMut.html +++ b/cu29/prelude/type.IterMut.html @@ -1 +1 @@ -IterMut in cu29::prelude - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file +IterMut in cu29::prelude - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29/prelude/type.NodeId.html b/cu29/prelude/type.NodeId.html index 6318243cf..3f8b97a3f 100644 --- a/cu29/prelude/type.NodeId.html +++ b/cu29/prelude/type.NodeId.html @@ -1,3 +1,3 @@ -NodeId in cu29::prelude - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph +NodeId in cu29::prelude - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph and the code generation.

\ No newline at end of file diff --git a/cu29/simulation/enum.CuTaskCallbackState.html b/cu29/simulation/enum.CuTaskCallbackState.html index 968915d54..eac0227dc 100644 --- a/cu29/simulation/enum.CuTaskCallbackState.html +++ b/cu29/simulation/enum.CuTaskCallbackState.html @@ -1,4 +1,4 @@ -CuTaskCallbackState in cu29::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where +CuTaskCallbackState in cu29::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where I: CuMsgPack<'cl>, O: CuMsgPack<'cl>,
{ New(Option<ComponentConfig>), diff --git a/cu29/simulation/enum.SimOverride.html b/cu29/simulation/enum.SimOverride.html index a7493a55b..8c9cde0d4 100644 --- a/cu29/simulation/enum.SimOverride.html +++ b/cu29/simulation/enum.SimOverride.html @@ -1,4 +1,4 @@ -SimOverride in cu29::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
+SimOverride in cu29::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
     ExecutedBySim,
     ExecuteByRuntime,
     Errored(String),
diff --git a/cu29/simulation/index.html b/cu29/simulation/index.html
index 281577a8d..e89170617 100644
--- a/cu29/simulation/index.html
+++ b/cu29/simulation/index.html
@@ -1,4 +1,4 @@
-cu29::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

+cu29::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

The cu29::simulation module provides an interface to simulate tasks in Copper-based systems. It offers structures, traits, and enums that enable hooking into the lifecycle of tasks, adapting their behavior, and integrating them with simulated hardware environments.

diff --git a/cu29/simulation/struct.CuSimSinkTask.html b/cu29/simulation/struct.CuSimSinkTask.html index ec962f676..dce7b5daf 100644 --- a/cu29/simulation/struct.CuSimSinkTask.html +++ b/cu29/simulation/struct.CuSimSinkTask.html @@ -1,4 +1,4 @@ -CuSimSinkTask in cu29::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. +CuSimSinkTask in cu29::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSinkTask<'cl> for CuSimSinkTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Input = &'cl CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSinkTask<T>, CuError>
where diff --git a/cu29/simulation/struct.CuSimSrcTask.html b/cu29/simulation/struct.CuSimSrcTask.html index 19bd0beba..ee903d515 100644 --- a/cu29/simulation/struct.CuSimSrcTask.html +++ b/cu29/simulation/struct.CuSimSrcTask.html @@ -1,4 +1,4 @@ -CuSimSrcTask in cu29::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. +CuSimSrcTask in cu29::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T> CuSrcTask<'cl> for CuSimSrcTask<T>
where T: CuMsgPayload + 'cl,

Source§

type Output = &'cl mut CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> Result<CuSimSrcTask<T>, CuError>
where diff --git a/cu29/struct.CuError.html b/cu29/struct.CuError.html index 2be44bf07..c45d92b2d 100644 --- a/cu29/struct.CuError.html +++ b/cu29/struct.CuError.html @@ -1,4 +1,4 @@ -CuError in cu29 - Rust

Struct CuError

pub struct CuError { /* private fields */ }
Expand description

Common copper Error type.

+CuError in cu29 - Rust

Struct CuError

pub struct CuError { /* private fields */ }
Expand description

Common copper Error type.

Implementations§

§

impl CuError

pub fn new_with_cause(message: &str, cause: impl Error) -> CuError

pub fn add_cause(self, context: &str) -> CuError

Trait Implementations§

§

impl Clone for CuError

§

fn clone(&self) -> CuError

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
§

impl Debug for CuError

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for CuError

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<CuError, <__D as Deserializer<'de>>::Error>
where diff --git a/cu29/trait.CopperListTuple.html b/cu29/trait.CopperListTuple.html index fc796cb5a..087e812e6 100644 --- a/cu29/trait.CopperListTuple.html +++ b/cu29/trait.CopperListTuple.html @@ -1,4 +1,4 @@ -CopperListTuple in cu29 - Rust

Trait CopperListTuple

pub trait CopperListTuple:
+CopperListTuple in cu29 - Rust

Trait CopperListTuple

pub trait CopperListTuple:
     Sized
     + Encode
     + Decode
diff --git a/cu29/trait.WriteStream.html b/cu29/trait.WriteStream.html
index 8f6fcab88..87f434fd5 100644
--- a/cu29/trait.WriteStream.html
+++ b/cu29/trait.WriteStream.html
@@ -1,4 +1,4 @@
-WriteStream in cu29 - Rust

Trait WriteStream

pub trait WriteStream<E>:
+WriteStream in cu29 - Rust

Trait WriteStream

pub trait WriteStream<E>:
     Sync
     + Send
     + Debug
where diff --git a/cu29/type.CuResult.html b/cu29/type.CuResult.html index a2c97de5e..1ebe3f609 100644 --- a/cu29/type.CuResult.html +++ b/cu29/type.CuResult.html @@ -1,4 +1,4 @@ -CuResult in cu29 - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
+CuResult in cu29 - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
     Ok(T),
     Err(CuError),
 }

Variants§

§1.0.0

Ok(T)

Contains the success value

diff --git a/cu29_clock/all.html b/cu29_clock/all.html index 2d40ceeda..5d7b656ff 100644 --- a/cu29_clock/all.html +++ b/cu29_clock/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_clock/enum.Tov.html b/cu29_clock/enum.Tov.html index 660ba1794..0ca32a272 100644 --- a/cu29_clock/enum.Tov.html +++ b/cu29_clock/enum.Tov.html @@ -1,4 +1,4 @@ -Tov in cu29_clock - Rust

Enum Tov

Source
pub enum Tov {
+Tov in cu29_clock - Rust

Enum Tov

Source
pub enum Tov {
     None,
     Time(CuTime),
     Range(CuTimeRange),
diff --git a/cu29_clock/index.html b/cu29_clock/index.html
index c6d434376..f0b3e32da 100644
--- a/cu29_clock/index.html
+++ b/cu29_clock/index.html
@@ -1,4 +1,4 @@
-cu29_clock - Rust

Crate cu29_clock

Source

Structs§

CuDuration
For Robot times, the underlying type is a u64 representing nanoseconds. +cu29_clock - Rust

Crate cu29_clock

Source

Structs§

CuDuration
For Robot times, the underlying type is a u64 representing nanoseconds. It is always positive to simplify the reasoning on the user side.
CuTimeRange
Represents a time range.
Instant
A point-in-time wall-clock measurement.
OptionCuTime
Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.
PartialCuTimeRange
Represents a time range with possible undefined start or end or both.
RobotClock
A running Robot clock. The clock is a monotonic clock that starts at an arbitrary reference time. It is clone resilient, ie a clone will be the same clock, even when mocked.
RobotClockMock
A mock clock that can be controlled by the user.

Enums§

Tov
The time of validity of a message can be more than one time but can be a time range of Tovs. diff --git a/cu29_clock/struct.CuDuration.html b/cu29_clock/struct.CuDuration.html index 00e54d2d7..daafc727d 100644 --- a/cu29_clock/struct.CuDuration.html +++ b/cu29_clock/struct.CuDuration.html @@ -1,4 +1,4 @@ -CuDuration in cu29_clock - Rust

Struct CuDuration

Source
pub struct CuDuration(pub u64);
Expand description

For Robot times, the underlying type is a u64 representing nanoseconds. +CuDuration in cu29_clock - Rust

Struct CuDuration

Source
pub struct CuDuration(pub u64);
Expand description

For Robot times, the underlying type is a u64 representing nanoseconds. It is always positive to simplify the reasoning on the user side.

Tuple Fields§

§0: u64

Implementations§

Source§

impl CuDuration

Source

pub const MIN: CuDuration

Source

pub const MAX: CuDuration

Source

pub fn max(&self, p0: CuDuration) -> CuDuration

Source

pub fn min(&self, p0: CuDuration) -> CuDuration

Source

pub fn as_nanos(&self) -> u64

Trait Implementations§

Source§

impl Add for CuDuration

Source§

type Output = CuDuration

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign for CuDuration

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<'de> BorrowDecode<'de> for CuDuration

Source§

fn borrow_decode<D: BorrowDecoder<'de>>( decoder: &mut D, diff --git a/cu29_clock/struct.CuTimeRange.html b/cu29_clock/struct.CuTimeRange.html index 1ca7973ac..865c104d5 100644 --- a/cu29_clock/struct.CuTimeRange.html +++ b/cu29_clock/struct.CuTimeRange.html @@ -1,4 +1,4 @@ -CuTimeRange in cu29_clock - Rust

Struct CuTimeRange

Source
pub struct CuTimeRange {
+CuTimeRange in cu29_clock - Rust

Struct CuTimeRange

Source
pub struct CuTimeRange {
     pub start: CuTime,
     pub end: CuTime,
 }
Expand description

Represents a time range.

diff --git a/cu29_clock/struct.Instant.html b/cu29_clock/struct.Instant.html index de7de2d6a..8604c6378 100644 --- a/cu29_clock/struct.Instant.html +++ b/cu29_clock/struct.Instant.html @@ -1,4 +1,4 @@ -Instant in cu29_clock - Rust

Struct Instant

pub struct Instant(/* private fields */);
Expand description

A point-in-time wall-clock measurement.

+Instant in cu29_clock - Rust

Struct Instant

pub struct Instant(/* private fields */);
Expand description

A point-in-time wall-clock measurement.

Mimics most of the functionality of std::time::Instant but provides an additional method for using the “recent time” feature of quanta.

§Monotonicity

diff --git a/cu29_clock/struct.OptionCuTime.html b/cu29_clock/struct.OptionCuTime.html index 3d6b7b400..799ab7b02 100644 --- a/cu29_clock/struct.OptionCuTime.html +++ b/cu29_clock/struct.OptionCuTime.html @@ -1,4 +1,4 @@ -OptionCuTime in cu29_clock - Rust

Struct OptionCuTime

Source
pub struct OptionCuTime(/* private fields */);
Expand description

Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.

+OptionCuTime in cu29_clock - Rust

Struct OptionCuTime

Source
pub struct OptionCuTime(/* private fields */);
Expand description

Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.

Implementations§

Source§

impl OptionCuTime

Source

pub fn is_none(&self) -> bool

Source

pub fn none() -> Self

Source

pub fn unwrap(self) -> CuTime

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for OptionCuTime

Source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for OptionCuTime

Source§

fn clone(&self) -> OptionCuTime

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 Debug for OptionCuTime

Source§

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

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

impl Decode for OptionCuTime

Source§

fn decode<__D: Decoder>(decoder: &mut __D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl Default for OptionCuTime

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for OptionCuTime

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where diff --git a/cu29_clock/struct.PartialCuTimeRange.html b/cu29_clock/struct.PartialCuTimeRange.html index 86f9b9946..9e3035680 100644 --- a/cu29_clock/struct.PartialCuTimeRange.html +++ b/cu29_clock/struct.PartialCuTimeRange.html @@ -1,4 +1,4 @@ -PartialCuTimeRange in cu29_clock - Rust

Struct PartialCuTimeRange

Source
pub struct PartialCuTimeRange {
+PartialCuTimeRange in cu29_clock - Rust

Struct PartialCuTimeRange

Source
pub struct PartialCuTimeRange {
     pub start: OptionCuTime,
     pub end: OptionCuTime,
 }
Expand description

Represents a time range with possible undefined start or end or both.

diff --git a/cu29_clock/struct.RobotClock.html b/cu29_clock/struct.RobotClock.html index 8e920a80e..5bf3f6c91 100644 --- a/cu29_clock/struct.RobotClock.html +++ b/cu29_clock/struct.RobotClock.html @@ -1,4 +1,4 @@ -RobotClock in cu29_clock - Rust

Struct RobotClock

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

A running Robot clock. +RobotClock in cu29_clock - Rust

Struct RobotClock

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

A running Robot clock. The clock is a monotonic clock that starts at an arbitrary reference time. It is clone resilient, ie a clone will be the same clock, even when mocked.

Implementations§

Source§

impl RobotClock

Source

pub fn new() -> Self

Creates a RobotClock using now as its reference time. diff --git a/cu29_clock/struct.RobotClockMock.html b/cu29_clock/struct.RobotClockMock.html index 0f2eb796a..f7cbc5205 100644 --- a/cu29_clock/struct.RobotClockMock.html +++ b/cu29_clock/struct.RobotClockMock.html @@ -1,4 +1,4 @@ -RobotClockMock in cu29_clock - Rust

Struct RobotClockMock

Source
pub struct RobotClockMock(/* private fields */);
Expand description

A mock clock that can be controlled by the user.

+RobotClockMock in cu29_clock - Rust

Struct RobotClockMock

Source
pub struct RobotClockMock(/* private fields */);
Expand description

A mock clock that can be controlled by the user.

Implementations§

Source§

impl RobotClockMock

Source

pub fn increment(&self, amount: Duration)

Source

pub fn decrement(&self, amount: Duration)

Decrements the time by the given amount. Be careful this brakes the monotonicity of the clock.

Source

pub fn value(&self) -> u64

Gets the current value of time.

diff --git a/cu29_clock/trait.ClockProvider.html b/cu29_clock/trait.ClockProvider.html index 2dbae29cd..3938b1845 100644 --- a/cu29_clock/trait.ClockProvider.html +++ b/cu29_clock/trait.ClockProvider.html @@ -1,4 +1,4 @@ -ClockProvider in cu29_clock - Rust

Trait ClockProvider

Source
pub trait ClockProvider {
+ClockProvider in cu29_clock - Rust

Trait ClockProvider

Source
pub trait ClockProvider {
     // Required method
     fn get_clock(&self) -> RobotClock;
 }
Expand description

A trait to provide a clock to the runtime.

diff --git a/cu29_clock/type.CuTime.html b/cu29_clock/type.CuTime.html index a1b96ae7f..0803d2316 100644 --- a/cu29_clock/type.CuTime.html +++ b/cu29_clock/type.CuTime.html @@ -1,2 +1,2 @@ -CuTime in cu29_clock - Rust

Type Alias CuTime

Source
pub type CuTime = CuDuration;
Expand description

A robot time is just a duration from a fixed point in time.

+CuTime in cu29_clock - Rust

Type Alias CuTime

Source
pub type CuTime = CuDuration;
Expand description

A robot time is just a duration from a fixed point in time.

Aliased Type§

struct CuTime(pub u64);

Fields§

§0: u64
\ No newline at end of file diff --git a/cu29_derive/all.html b/cu29_derive/all.html index b78f8190d..847d3f1f1 100644 --- a/cu29_derive/all.html +++ b/cu29_derive/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Macros

Attribute Macros

\ No newline at end of file +List of all items in this crate

List of all items

Macros

Attribute Macros

\ No newline at end of file diff --git a/cu29_derive/attr.copper_runtime.html b/cu29_derive/attr.copper_runtime.html index 4258f8557..70452b93c 100644 --- a/cu29_derive/attr.copper_runtime.html +++ b/cu29_derive/attr.copper_runtime.html @@ -1,4 +1,4 @@ -copper_runtime in cu29_derive - Rust

Attribute Macro copper_runtime

Source
#[copper_runtime]
Expand description

Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. +copper_runtime in cu29_derive - Rust

Attribute Macro copper_runtime

Source
#[copper_runtime]
Expand description

Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. if sim_mode is omitted, it is set to false. This will add a “runtime” field to your struct and implement the “new” and “run” methods.

\ No newline at end of file diff --git a/cu29_derive/index.html b/cu29_derive/index.html index 7ed2db54f..6a0a18d88 100644 --- a/cu29_derive/index.html +++ b/cu29_derive/index.html @@ -1,4 +1,4 @@ -cu29_derive - Rust

Crate cu29_derive

Source

Macros§

gen_cumsgs
Generates the CopperList content type from a config. +cu29_derive - Rust

Crate cu29_derive

Source

Macros§

gen_cumsgs
Generates the CopperList content type from a config. gen_cumsgs!(“path/to/config.toml”) It will create a new type called CuMsgs you can pass to the log reader for decoding:

Attribute Macros§

copper_runtime
Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. if sim_mode is omitted, it is set to false. diff --git a/cu29_derive/macro.gen_cumsgs.html b/cu29_derive/macro.gen_cumsgs.html index 7fac811f8..62cb5c534 100644 --- a/cu29_derive/macro.gen_cumsgs.html +++ b/cu29_derive/macro.gen_cumsgs.html @@ -1,4 +1,4 @@ -gen_cumsgs in cu29_derive - Rust

Macro gen_cumsgs

Source
gen_cumsgs!() { /* proc-macro */ }
Expand description

Generates the CopperList content type from a config. +gen_cumsgs in cu29_derive - Rust

Macro gen_cumsgs

Source
gen_cumsgs!() { /* proc-macro */ }
Expand description

Generates the CopperList content type from a config. gen_cumsgs!(“path/to/config.toml”) It will create a new type called CuMsgs you can pass to the log reader for decoding:

\ No newline at end of file diff --git a/cu29_export/all.html b/cu29_export/all.html index 4325b43ad..9746241a4 100644 --- a/cu29_export/all.html +++ b/cu29_export/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_export/enum.Command.html b/cu29_export/enum.Command.html index 67ff76608..a1a883039 100644 --- a/cu29_export/enum.Command.html +++ b/cu29_export/enum.Command.html @@ -1,4 +1,4 @@ -Command in cu29_export - Rust

Enum Command

Source
pub enum Command {
+Command in cu29_export - Rust

Enum Command

Source
pub enum Command {
     ExtractLog {
         log_index: PathBuf,
     },
diff --git a/cu29_export/enum.ExportFormat.html b/cu29_export/enum.ExportFormat.html
index 239098d69..7e48fb151 100644
--- a/cu29_export/enum.ExportFormat.html
+++ b/cu29_export/enum.ExportFormat.html
@@ -1,4 +1,4 @@
-ExportFormat in cu29_export - Rust

Enum ExportFormat

Source
pub enum ExportFormat {
+ExportFormat in cu29_export - Rust

Enum ExportFormat

Source
pub enum ExportFormat {
     Json,
     Csv,
 }

Variants§

§

Json

§

Csv

Trait Implementations§

Source§

impl Clone for ExportFormat

Source§

fn clone(&self) -> ExportFormat

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 Display for ExportFormat

Source§

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

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

impl Ord for ExportFormat

Source§

fn cmp(&self, other: &ExportFormat) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where diff --git a/cu29_export/fn.copperlists_dump.html b/cu29_export/fn.copperlists_dump.html index 46b6a9583..bed56c49d 100644 --- a/cu29_export/fn.copperlists_dump.html +++ b/cu29_export/fn.copperlists_dump.html @@ -1,4 +1,4 @@ -copperlists_dump in cu29_export - Rust

Function copperlists_dump

Source
pub fn copperlists_dump<P: CopperListTuple>(
+copperlists_dump in cu29_export - Rust

Function copperlists_dump

Source
pub fn copperlists_dump<P: CopperListTuple>(
     src: impl Read,
 ) -> impl Iterator<Item = CopperList<P>>
Expand description

Extracts the copper lists from a binary representation. P is the Payload determined by the configuration of the application.

diff --git a/cu29_export/fn.run_cli.html b/cu29_export/fn.run_cli.html index 9586b2e32..f2bee4df7 100644 --- a/cu29_export/fn.run_cli.html +++ b/cu29_export/fn.run_cli.html @@ -1,4 +1,4 @@ -run_cli in cu29_export - Rust

Function run_cli

Source
pub fn run_cli<P>() -> CuResult<()>
where +run_cli in cu29_export - Rust

Function run_cli

Source
pub fn run_cli<P>() -> CuResult<()>
where P: CopperListTuple,
Expand description

This is a generator for a main function to build a log extractor. It depends on the specific type of the CopperList payload that is determined at compile time from the configuration.

\ No newline at end of file diff --git a/cu29_export/fn.textlog_dump.html b/cu29_export/fn.textlog_dump.html index 95527ab38..d6ac6b19d 100644 --- a/cu29_export/fn.textlog_dump.html +++ b/cu29_export/fn.textlog_dump.html @@ -1,4 +1,4 @@ -textlog_dump in cu29_export - Rust

Function textlog_dump

Source
pub fn textlog_dump(src: impl Read, index: &Path) -> CuResult<()>
Expand description

Full dump of the copper structured log from its binary representation. +textlog_dump in cu29_export - Rust

Function textlog_dump

Source
pub fn textlog_dump(src: impl Read, index: &Path) -> CuResult<()>
Expand description

Full dump of the copper structured log from its binary representation. This rebuilds a textual log. src: the source of the log data index: the path to the index file (containing the interned strings constructed at build time)

diff --git a/cu29_export/index.html b/cu29_export/index.html index 85d6b5949..5f36aeae2 100644 --- a/cu29_export/index.html +++ b/cu29_export/index.html @@ -1,4 +1,4 @@ -cu29_export - Rust

Crate cu29_export

Source

Structs§

LogReaderCli
This is a generator for a main function to build a log extractor.

Enums§

Command
ExportFormat

Functions§

copperlists_dump
Extracts the copper lists from a binary representation. +cu29_export - Rust

Crate cu29_export

Source

Structs§

LogReaderCli
This is a generator for a main function to build a log extractor.

Enums§

Command
ExportFormat

Functions§

copperlists_dump
Extracts the copper lists from a binary representation. P is the Payload determined by the configuration of the application.
run_cli
This is a generator for a main function to build a log extractor. It depends on the specific type of the CopperList payload that is determined at compile time from the configuration.
textlog_dump
Full dump of the copper structured log from its binary representation. This rebuilds a textual log. diff --git a/cu29_export/struct.LogReaderCli.html b/cu29_export/struct.LogReaderCli.html index 51ab1e93d..82e002fb7 100644 --- a/cu29_export/struct.LogReaderCli.html +++ b/cu29_export/struct.LogReaderCli.html @@ -1,4 +1,4 @@ -LogReaderCli in cu29_export - Rust

Struct LogReaderCli

Source
pub struct LogReaderCli {
+LogReaderCli in cu29_export - Rust

Struct LogReaderCli

Source
pub struct LogReaderCli {
     pub unifiedlog_base: PathBuf,
     pub command: Command,
 }
Expand description

This is a generator for a main function to build a log extractor.

diff --git a/cu29_helpers/all.html b/cu29_helpers/all.html index 55a404e46..e3a4ef9e4 100644 --- a/cu29_helpers/all.html +++ b/cu29_helpers/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/cu29_helpers/fn.basic_copper_setup.html b/cu29_helpers/fn.basic_copper_setup.html index db4be2912..226afcae1 100644 --- a/cu29_helpers/fn.basic_copper_setup.html +++ b/cu29_helpers/fn.basic_copper_setup.html @@ -1,4 +1,4 @@ -basic_copper_setup in cu29_helpers - Rust

Function basic_copper_setup

Source
pub fn basic_copper_setup(
+basic_copper_setup in cu29_helpers - Rust

Function basic_copper_setup

Source
pub fn basic_copper_setup(
     unifiedlogger_output_base_name: &Path,
     slab_size: Option<usize>,
     _text_log: bool,
diff --git a/cu29_helpers/index.html b/cu29_helpers/index.html
index 629387da5..8547a60e4 100644
--- a/cu29_helpers/index.html
+++ b/cu29_helpers/index.html
@@ -1,2 +1,2 @@
-cu29_helpers - Rust

Crate cu29_helpers

Source

Functions§

basic_copper_setup
This is a basic setup for a copper application to get you started. +cu29_helpers - Rust

Crate cu29_helpers

Source

Functions§

basic_copper_setup
This is a basic setup for a copper application to get you started. Duplicate and customize as needed when your needs grow.
\ No newline at end of file diff --git a/cu29_intern_strs/all.html b/cu29_intern_strs/all.html index 989e3b8c5..e6792faa3 100644 --- a/cu29_intern_strs/all.html +++ b/cu29_intern_strs/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/cu29_intern_strs/fn.read_interned_strings.html b/cu29_intern_strs/fn.read_interned_strings.html index 2c8dfca3f..4280c2849 100644 --- a/cu29_intern_strs/fn.read_interned_strings.html +++ b/cu29_intern_strs/fn.read_interned_strings.html @@ -1,2 +1,2 @@ -read_interned_strings in cu29_intern_strs - Rust

Function read_interned_strings

Source
pub fn read_interned_strings(index: &Path) -> CuResult<Vec<String>>
Expand description

Rebuild the interned string index in memory.

+read_interned_strings in cu29_intern_strs - Rust

Function read_interned_strings

Source
pub fn read_interned_strings(index: &Path) -> CuResult<Vec<String>>
Expand description

Rebuild the interned string index in memory.

\ No newline at end of file diff --git a/cu29_intern_strs/index.html b/cu29_intern_strs/index.html index a33b79651..a35419355 100644 --- a/cu29_intern_strs/index.html +++ b/cu29_intern_strs/index.html @@ -1 +1 @@ -cu29_intern_strs - Rust

Crate cu29_intern_strs

Source

Functions§

read_interned_strings
Rebuild the interned string index in memory.
\ No newline at end of file +cu29_intern_strs - Rust

Crate cu29_intern_strs

Source

Functions§

read_interned_strings
Rebuild the interned string index in memory.
\ No newline at end of file diff --git a/cu29_log/all.html b/cu29_log/all.html index 3043935a1..55591ee63 100644 --- a/cu29_log/all.html +++ b/cu29_log/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_log/constant.ANONYMOUS.html b/cu29_log/constant.ANONYMOUS.html index c43fc863b..c92262cd0 100644 --- a/cu29_log/constant.ANONYMOUS.html +++ b/cu29_log/constant.ANONYMOUS.html @@ -1 +1 @@ -ANONYMOUS in cu29_log - Rust

Constant ANONYMOUS

Source
pub const ANONYMOUS: u32 = 0;
\ No newline at end of file +ANONYMOUS in cu29_log - Rust

Constant ANONYMOUS

Source
pub const ANONYMOUS: u32 = 0;
\ No newline at end of file diff --git a/cu29_log/constant.MAX_LOG_PARAMS_ON_STACK.html b/cu29_log/constant.MAX_LOG_PARAMS_ON_STACK.html index 5eb58375a..02cb640da 100644 --- a/cu29_log/constant.MAX_LOG_PARAMS_ON_STACK.html +++ b/cu29_log/constant.MAX_LOG_PARAMS_ON_STACK.html @@ -1 +1 @@ -MAX_LOG_PARAMS_ON_STACK in cu29_log - Rust

Constant MAX_LOG_PARAMS_ON_STACK

Source
pub const MAX_LOG_PARAMS_ON_STACK: usize = 10;
\ No newline at end of file +MAX_LOG_PARAMS_ON_STACK in cu29_log - Rust

Constant MAX_LOG_PARAMS_ON_STACK

Source
pub const MAX_LOG_PARAMS_ON_STACK: usize = 10;
\ No newline at end of file diff --git a/cu29_log/fn.default_log_index_dir.html b/cu29_log/fn.default_log_index_dir.html index b6d6a36d8..4cb152ae6 100644 --- a/cu29_log/fn.default_log_index_dir.html +++ b/cu29_log/fn.default_log_index_dir.html @@ -1,2 +1,2 @@ -default_log_index_dir in cu29_log - Rust

Function default_log_index_dir

Source
pub fn default_log_index_dir() -> PathBuf
Expand description

Convenience function to returns the default path for the log index directory.

+default_log_index_dir in cu29_log - Rust

Function default_log_index_dir

Source
pub fn default_log_index_dir() -> PathBuf
Expand description

Convenience function to returns the default path for the log index directory.

\ No newline at end of file diff --git a/cu29_log/fn.format_logline.html b/cu29_log/fn.format_logline.html index 3068ca5af..7c2a867f6 100644 --- a/cu29_log/fn.format_logline.html +++ b/cu29_log/fn.format_logline.html @@ -1,4 +1,4 @@ -format_logline in cu29_log - Rust

Function format_logline

Source
pub fn format_logline(
+format_logline in cu29_log - Rust

Function format_logline

Source
pub fn format_logline(
     time: CuTime,
     format_str: &str,
     params: &[String],
diff --git a/cu29_log/fn.rebuild_logline.html b/cu29_log/fn.rebuild_logline.html
index 1582660c3..34b110861 100644
--- a/cu29_log/fn.rebuild_logline.html
+++ b/cu29_log/fn.rebuild_logline.html
@@ -1,4 +1,4 @@
-rebuild_logline in cu29_log - Rust

Function rebuild_logline

Source
pub fn rebuild_logline(
+rebuild_logline in cu29_log - Rust

Function rebuild_logline

Source
pub fn rebuild_logline(
     all_interned_strings: &[String],
     entry: &CuLogEntry,
 ) -> CuResult<String>
Expand description

Rebuild a log line from the interned strings and the CuLogEntry. diff --git a/cu29_log/index.html b/cu29_log/index.html index 99aa18905..3f9e41af9 100644 --- a/cu29_log/index.html +++ b/cu29_log/index.html @@ -1,2 +1,2 @@ -cu29_log - Rust

Crate cu29_log

Source

Structs§

CuLogEntry
This is the basic structure for a log entry in Copper.

Constants§

ANONYMOUS
MAX_LOG_PARAMS_ON_STACK

Functions§

default_log_index_dir
Convenience function to returns the default path for the log index directory.
format_logline
Text log line formatter.
rebuild_logline
Rebuild a log line from the interned strings and the CuLogEntry. +cu29_log - Rust

Crate cu29_log

Source

Structs§

CuLogEntry
This is the basic structure for a log entry in Copper.

Constants§

ANONYMOUS
MAX_LOG_PARAMS_ON_STACK

Functions§

default_log_index_dir
Convenience function to returns the default path for the log index directory.
format_logline
Text log line formatter.
rebuild_logline
Rebuild a log line from the interned strings and the CuLogEntry. This basically translates the world of copper logs to text logs.
\ No newline at end of file diff --git a/cu29_log/struct.CuLogEntry.html b/cu29_log/struct.CuLogEntry.html index 8b9f370c4..fec45b8f8 100644 --- a/cu29_log/struct.CuLogEntry.html +++ b/cu29_log/struct.CuLogEntry.html @@ -1,4 +1,4 @@ -CuLogEntry in cu29_log - Rust

Struct CuLogEntry

Source
pub struct CuLogEntry {
+CuLogEntry in cu29_log - Rust

Struct CuLogEntry

Source
pub struct CuLogEntry {
     pub time: CuTime,
     pub msg_index: u32,
     pub paramname_indexes: SmallVec<[u32; 10]>,
diff --git a/cu29_log_derive/all.html b/cu29_log_derive/all.html
index abe3697ff..903e354a0 100644
--- a/cu29_log_derive/all.html
+++ b/cu29_log_derive/all.html
@@ -1 +1 @@
-List of all items in this crate

List of all items

Macros

\ No newline at end of file +List of all items in this crate

List of all items

Macros

\ No newline at end of file diff --git a/cu29_log_derive/index.html b/cu29_log_derive/index.html index c771bfdfa..77c1ae011 100644 --- a/cu29_log_derive/index.html +++ b/cu29_log_derive/index.html @@ -1,4 +1,4 @@ -cu29_log_derive - Rust

Crate cu29_log_derive

Source

Macros§

debug
This macro is used to log a message with parameters. +cu29_log_derive - Rust

Crate cu29_log_derive

Source

Macros§

debug
This macro is used to log a message with parameters. The first parameter is a string literal that represents the message to be logged. Only {} is supported as a placeholder for parameters. The rest of the parameters are the values to be logged. diff --git a/cu29_log_derive/macro.debug.html b/cu29_log_derive/macro.debug.html index 1e92ac7ad..dee7e157e 100644 --- a/cu29_log_derive/macro.debug.html +++ b/cu29_log_derive/macro.debug.html @@ -1,4 +1,4 @@ -debug in cu29_log_derive - Rust

Macro debug

Source
debug!() { /* proc-macro */ }
Expand description

This macro is used to log a message with parameters. +debug in cu29_log_derive - Rust

Macro debug

Source
debug!() { /* proc-macro */ }
Expand description

This macro is used to log a message with parameters. The first parameter is a string literal that represents the message to be logged. Only {} is supported as a placeholder for parameters. The rest of the parameters are the values to be logged. diff --git a/cu29_log_runtime/all.html b/cu29_log_runtime/all.html index f9563f66b..ac34f347d 100644 --- a/cu29_log_runtime/all.html +++ b/cu29_log_runtime/all.html @@ -1 +1 @@ -List of all items in this crate

\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_log_runtime/fn.log.html b/cu29_log_runtime/fn.log.html index ecfbe244a..7784468ba 100644 --- a/cu29_log_runtime/fn.log.html +++ b/cu29_log_runtime/fn.log.html @@ -1,3 +1,3 @@ -log in cu29_log_runtime - Rust

Function log

Source
pub fn log(entry: &mut CuLogEntry) -> CuResult<()>
Expand description

Function called from generated code to log data. +log in cu29_log_runtime - Rust

Function log

Source
pub fn log(entry: &mut CuLogEntry) -> CuResult<()>
Expand description

Function called from generated code to log data. It moves entry by design, it will be absorbed in the queue.

\ No newline at end of file diff --git a/cu29_log_runtime/fn.log_debug_mode.html b/cu29_log_runtime/fn.log_debug_mode.html index 7f9d86868..1a8c3c3c3 100644 --- a/cu29_log_runtime/fn.log_debug_mode.html +++ b/cu29_log_runtime/fn.log_debug_mode.html @@ -1,4 +1,4 @@ -log_debug_mode in cu29_log_runtime - Rust

Function log_debug_mode

Source
pub fn log_debug_mode(
+log_debug_mode in cu29_log_runtime - Rust

Function log_debug_mode

Source
pub fn log_debug_mode(
     entry: &mut CuLogEntry,
     format_str: &str,
     param_names: &[&str],
diff --git a/cu29_log_runtime/index.html b/cu29_log_runtime/index.html
index 6dcecf217..5f9fcbab2 100644
--- a/cu29_log_runtime/index.html
+++ b/cu29_log_runtime/index.html
@@ -1,3 +1,3 @@
-cu29_log_runtime - Rust

Crate cu29_log_runtime

Source

Structs§

LoggerRuntime
The lifetime of this struct is the lifetime of the logger.
NullLog
OwningIoWriter
SimpleFileWriter
This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

Statics§

EXTRA_TEXT_LOGGER

Functions§

log
Function called from generated code to log data. +cu29_log_runtime - Rust

Crate cu29_log_runtime

Source

Structs§

LoggerRuntime
The lifetime of this struct is the lifetime of the logger.
NullLog
OwningIoWriter
SimpleFileWriter
This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

Statics§

EXTRA_TEXT_LOGGER

Functions§

log
Function called from generated code to log data. It moves entry by design, it will be absorbed in the queue.
log_debug_mode
This version of log is only compiled in debug mode This allows a normal logging framework to be bridged.
\ No newline at end of file diff --git a/cu29_log_runtime/static.EXTRA_TEXT_LOGGER.html b/cu29_log_runtime/static.EXTRA_TEXT_LOGGER.html index e153d528c..5fcdf907c 100644 --- a/cu29_log_runtime/static.EXTRA_TEXT_LOGGER.html +++ b/cu29_log_runtime/static.EXTRA_TEXT_LOGGER.html @@ -1 +1 @@ -EXTRA_TEXT_LOGGER in cu29_log_runtime - Rust

Static EXTRA_TEXT_LOGGER

Source
pub static EXTRA_TEXT_LOGGER: RwLock<Option<Box<dyn Log + 'static>>>
\ No newline at end of file +EXTRA_TEXT_LOGGER in cu29_log_runtime - Rust

Static EXTRA_TEXT_LOGGER

Source
pub static EXTRA_TEXT_LOGGER: RwLock<Option<Box<dyn Log + 'static>>>
\ No newline at end of file diff --git a/cu29_log_runtime/struct.LoggerRuntime.html b/cu29_log_runtime/struct.LoggerRuntime.html index d51b0f9e9..9ce1512d8 100644 --- a/cu29_log_runtime/struct.LoggerRuntime.html +++ b/cu29_log_runtime/struct.LoggerRuntime.html @@ -1,4 +1,4 @@ -LoggerRuntime in cu29_log_runtime - Rust

Struct LoggerRuntime

Source
pub struct LoggerRuntime {}
Expand description

The lifetime of this struct is the lifetime of the logger.

+LoggerRuntime in cu29_log_runtime - Rust

Struct LoggerRuntime

Source
pub struct LoggerRuntime {}
Expand description

The lifetime of this struct is the lifetime of the logger.

Implementations§

Source§

impl LoggerRuntime

Source

pub fn init( clock: RobotClock, destination: impl WriteStream<CuLogEntry> + 'static, diff --git a/cu29_log_runtime/struct.NullLog.html b/cu29_log_runtime/struct.NullLog.html index 31800a88c..cb0722e04 100644 --- a/cu29_log_runtime/struct.NullLog.html +++ b/cu29_log_runtime/struct.NullLog.html @@ -1,4 +1,4 @@ -NullLog in cu29_log_runtime - Rust

Struct NullLog

Source
pub struct NullLog;

Trait Implementations§

Source§

impl Log for NullLog

Source§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be +NullLog in cu29_log_runtime - Rust

Struct NullLog

Source
pub struct NullLog;

Trait Implementations§

Source§

impl Log for NullLog

Source§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, _record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records. Read more

Auto Trait Implementations§

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 diff --git a/cu29_log_runtime/struct.OwningIoWriter.html b/cu29_log_runtime/struct.OwningIoWriter.html index 8bb3d1e74..b804fe2e6 100644 --- a/cu29_log_runtime/struct.OwningIoWriter.html +++ b/cu29_log_runtime/struct.OwningIoWriter.html @@ -1,4 +1,4 @@ -OwningIoWriter in cu29_log_runtime - Rust

Struct OwningIoWriter

Source
pub struct OwningIoWriter<W: Write> { /* private fields */ }

Implementations§

Source§

impl<W: Write> OwningIoWriter<W>

Source

pub fn new(writer: W) -> Self

Source

pub fn bytes_written(&self) -> usize

Source

pub fn flush(&mut self) -> Result<(), EncodeError>

Trait Implementations§

Source§

impl<W: Write> Writer for OwningIoWriter<W>

Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>

Write bytes to the underlying writer. Exactly bytes.len() bytes must be written, or else an error should be returned.

Auto Trait Implementations§

§

impl<W> Freeze for OwningIoWriter<W>
where +OwningIoWriter in cu29_log_runtime - Rust

Struct OwningIoWriter

Source
pub struct OwningIoWriter<W: Write> { /* private fields */ }

Implementations§

Source§

impl<W: Write> OwningIoWriter<W>

Source

pub fn new(writer: W) -> Self

Source

pub fn bytes_written(&self) -> usize

Source

pub fn flush(&mut self) -> Result<(), EncodeError>

Trait Implementations§

Source§

impl<W: Write> Writer for OwningIoWriter<W>

Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), EncodeError>

Write bytes to the underlying writer. Exactly bytes.len() bytes must be written, or else an error should be returned.

Auto Trait Implementations§

§

impl<W> Freeze for OwningIoWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for OwningIoWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for OwningIoWriter<W>
where W: Send,

§

impl<W> Sync for OwningIoWriter<W>
where diff --git a/cu29_log_runtime/struct.SimpleFileWriter.html b/cu29_log_runtime/struct.SimpleFileWriter.html index 15d6e96b7..77c2b2832 100644 --- a/cu29_log_runtime/struct.SimpleFileWriter.html +++ b/cu29_log_runtime/struct.SimpleFileWriter.html @@ -1,4 +1,4 @@ -SimpleFileWriter in cu29_log_runtime - Rust

Struct SimpleFileWriter

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

This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

+SimpleFileWriter in cu29_log_runtime - Rust

Struct SimpleFileWriter

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

This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.

Implementations§

Source§

impl SimpleFileWriter

Source

pub fn new(path: &PathBuf) -> CuResult<Self>

Trait Implementations§

Source§

impl Debug for SimpleFileWriter

Source§

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

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

impl WriteStream<CuLogEntry> for SimpleFileWriter

Source§

fn log(&mut self, obj: &CuLogEntry) -> CuResult<()>

Source§

fn flush(&mut self) -> CuResult<()>

Auto Trait Implementations§

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 diff --git a/cu29_rendercfg/all.html b/cu29_rendercfg/all.html index 39d279c8a..c66e4812e 100644 --- a/cu29_rendercfg/all.html +++ b/cu29_rendercfg/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_rendercfg/config/fn.default_as_true.html b/cu29_rendercfg/config/fn.default_as_true.html index 43805a1bf..95c4a27ee 100644 --- a/cu29_rendercfg/config/fn.default_as_true.html +++ b/cu29_rendercfg/config/fn.default_as_true.html @@ -1 +1 @@ -default_as_true in cu29_rendercfg::config - Rust

Function default_as_true

Source
fn default_as_true() -> bool
\ No newline at end of file +default_as_true in cu29_rendercfg::config - Rust

Function default_as_true

Source
fn default_as_true() -> bool
\ No newline at end of file diff --git a/cu29_rendercfg/config/fn.read_configuration.html b/cu29_rendercfg/config/fn.read_configuration.html index baf2ea85f..dc25e1363 100644 --- a/cu29_rendercfg/config/fn.read_configuration.html +++ b/cu29_rendercfg/config/fn.read_configuration.html @@ -1,2 +1,2 @@ -read_configuration in cu29_rendercfg::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29_rendercfg::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29_rendercfg/config/fn.read_configuration_str.html b/cu29_rendercfg/config/fn.read_configuration_str.html index 849a3285a..f73da39a2 100644 --- a/cu29_rendercfg/config/fn.read_configuration_str.html +++ b/cu29_rendercfg/config/fn.read_configuration_str.html @@ -1,2 +1,2 @@ -read_configuration_str in cu29_rendercfg::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(config_content: String) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a String.

+read_configuration_str in cu29_rendercfg::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(config_content: String) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a String.

\ No newline at end of file diff --git a/cu29_rendercfg/config/index.html b/cu29_rendercfg/config/index.html index 6be25e638..ebce11d8e 100644 --- a/cu29_rendercfg/config/index.html +++ b/cu29_rendercfg/config/index.html @@ -1,4 +1,4 @@ -cu29_rendercfg::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. +cu29_rendercfg::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.

diff --git a/cu29_rendercfg/config/struct.Cnx.html b/cu29_rendercfg/config/struct.Cnx.html index 6099eafc6..71aefdd69 100644 --- a/cu29_rendercfg/config/struct.Cnx.html +++ b/cu29_rendercfg/config/struct.Cnx.html @@ -1,4 +1,4 @@ -Cnx in cu29_rendercfg::config - Rust

Struct Cnx

Source
pub struct Cnx {
+Cnx in cu29_rendercfg::config - Rust

Struct Cnx

Source
pub struct Cnx {
     src: String,
     dst: String,
     pub msg: String,
diff --git a/cu29_rendercfg/config/struct.ComponentConfig.html b/cu29_rendercfg/config/struct.ComponentConfig.html
index e5321809c..163321592 100644
--- a/cu29_rendercfg/config/struct.ComponentConfig.html
+++ b/cu29_rendercfg/config/struct.ComponentConfig.html
@@ -1,4 +1,4 @@
-ComponentConfig in cu29_rendercfg::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w +ComponentConfig in cu29_rendercfg::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.

Tuple Fields§

§0: HashMap<String, Value>

Implementations§

Source§

impl ComponentConfig

Source

pub fn new() -> Self

Source

pub fn get<T: From<Value>>(&self, key: &str) -> Option<T>

Source

pub fn set<T: Into<Value>>(&mut self, key: &str, value: T)

Trait Implementations§

Source§

impl Clone for ComponentConfig

Source§

fn clone(&self) -> ComponentConfig

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 Debug for ComponentConfig

Source§

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

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

impl Default for ComponentConfig

Source§

fn default() -> ComponentConfig

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

impl<'de> Deserialize<'de> for ComponentConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where diff --git a/cu29_rendercfg/config/struct.CuConfig.html b/cu29_rendercfg/config/struct.CuConfig.html index fe42bba1d..9d26710e4 100644 --- a/cu29_rendercfg/config/struct.CuConfig.html +++ b/cu29_rendercfg/config/struct.CuConfig.html @@ -1,4 +1,4 @@ -CuConfig in cu29_rendercfg::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
+CuConfig in cu29_rendercfg::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
     pub graph: StableDiGraph<Node, Cnx, u32>,
     pub monitor: Option<MonitorConfig>,
     pub logging: Option<LoggingConfig>,
diff --git a/cu29_rendercfg/config/struct.CuConfigRepresentation.html b/cu29_rendercfg/config/struct.CuConfigRepresentation.html
index 24ffec31f..4f657a047 100644
--- a/cu29_rendercfg/config/struct.CuConfigRepresentation.html
+++ b/cu29_rendercfg/config/struct.CuConfigRepresentation.html
@@ -1,4 +1,4 @@
-CuConfigRepresentation in cu29_rendercfg::config - Rust

Struct CuConfigRepresentation

Source
struct CuConfigRepresentation {
+CuConfigRepresentation in cu29_rendercfg::config - Rust

Struct CuConfigRepresentation

Source
struct CuConfigRepresentation {
     tasks: Vec<Node>,
     cnx: Vec<Cnx>,
     monitor: Option<MonitorConfig>,
diff --git a/cu29_rendercfg/config/struct.LoggingConfig.html b/cu29_rendercfg/config/struct.LoggingConfig.html
index 2f99a66bc..153828fcd 100644
--- a/cu29_rendercfg/config/struct.LoggingConfig.html
+++ b/cu29_rendercfg/config/struct.LoggingConfig.html
@@ -1,4 +1,4 @@
-LoggingConfig in cu29_rendercfg::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
+LoggingConfig in cu29_rendercfg::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
     pub slab_size_mib: Option<u64>,
     pub section_size_mib: Option<u64>,
     pub enable_task_logging: bool,
diff --git a/cu29_rendercfg/config/struct.MonitorConfig.html b/cu29_rendercfg/config/struct.MonitorConfig.html
index 2da36d4c8..34791b476 100644
--- a/cu29_rendercfg/config/struct.MonitorConfig.html
+++ b/cu29_rendercfg/config/struct.MonitorConfig.html
@@ -1,4 +1,4 @@
-MonitorConfig in cu29_rendercfg::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig {
+MonitorConfig in cu29_rendercfg::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig {
     type_: String,
     config: Option<ComponentConfig>,
 }

Fields§

§type_: String§config: Option<ComponentConfig>

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where diff --git a/cu29_rendercfg/config/struct.Node.html b/cu29_rendercfg/config/struct.Node.html index a6f539951..191edfe2b 100644 --- a/cu29_rendercfg/config/struct.Node.html +++ b/cu29_rendercfg/config/struct.Node.html @@ -1,4 +1,4 @@ -Node in cu29_rendercfg::config - Rust

Struct Node

Source
pub struct Node {
+Node in cu29_rendercfg::config - Rust

Struct Node

Source
pub struct Node {
     id: String,
     type_: Option<String>,
     config: Option<ComponentConfig>,
diff --git a/cu29_rendercfg/config/struct.Value.html b/cu29_rendercfg/config/struct.Value.html
index f541696b9..dd9365a72 100644
--- a/cu29_rendercfg/config/struct.Value.html
+++ b/cu29_rendercfg/config/struct.Value.html
@@ -1,4 +1,4 @@
-Value in cu29_rendercfg::config - Rust

Struct Value

Source
pub struct Value(Value);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

+Value in cu29_rendercfg::config - Rust

Struct Value

Source
pub struct Value(Value);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

Tuple Fields§

§0: Value

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 Debug for Value

Source§

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

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

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Value

Source§

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

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

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for String

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for bool

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for f64

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for i32

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for u32

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for u8

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> 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 Serialize for Value

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where diff --git a/cu29_rendercfg/config/type.NodeId.html b/cu29_rendercfg/config/type.NodeId.html index b02bda673..1cb725242 100644 --- a/cu29_rendercfg/config/type.NodeId.html +++ b/cu29_rendercfg/config/type.NodeId.html @@ -1,3 +1,3 @@ -NodeId in cu29_rendercfg::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph +NodeId in cu29_rendercfg::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph and the code generation.

\ No newline at end of file diff --git a/cu29_rendercfg/enum.UnifiedLogType.html b/cu29_rendercfg/enum.UnifiedLogType.html index 7d1e962c2..1b29d6edb 100644 --- a/cu29_rendercfg/enum.UnifiedLogType.html +++ b/cu29_rendercfg/enum.UnifiedLogType.html @@ -1,4 +1,4 @@ -UnifiedLogType in cu29_rendercfg - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
+UnifiedLogType in cu29_rendercfg - Rust

Enum UnifiedLogType

pub enum UnifiedLogType {
     Empty,
     StructuredLogLine,
     CopperList,
diff --git a/cu29_rendercfg/fn.main.html b/cu29_rendercfg/fn.main.html
index 9eb70777a..077c01353 100644
--- a/cu29_rendercfg/fn.main.html
+++ b/cu29_rendercfg/fn.main.html
@@ -1,2 +1,2 @@
-main in cu29_rendercfg - Rust

Function main

Source
pub(crate) fn main() -> Result<()>
Expand description

Render the configuration file to a dot file then convert it to an SVG and optionally opens it with inkscape.

+main in cu29_rendercfg - Rust

Function main

Source
pub(crate) fn main() -> Result<()>
Expand description

Render the configuration file to a dot file then convert it to an SVG and optionally opens it with inkscape.

\ No newline at end of file diff --git a/cu29_rendercfg/index.html b/cu29_rendercfg/index.html index 2d70ed730..781bf3968 100644 --- a/cu29_rendercfg/index.html +++ b/cu29_rendercfg/index.html @@ -1,4 +1,4 @@ -cu29_rendercfg - Rust

Crate cu29_rendercfg

Source

Modules§

config 🔒
This module defines the configuration of the copper runtime. +cu29_rendercfg - Rust

Crate cu29_rendercfg

Source

Modules§

config 🔒
This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.

Structs§

Args 🔒
CuError
Common copper Error type.

Enums§

UnifiedLogType
Defines the types of what can be logged in the unified logger.

Traits§

CopperListTuple
A CopperListTuple needs to be encodable, decodable and fixed size in memory.
WriteStream
Defines a basic write, append only stream trait to be able to log or send serializable objects.

Functions§

main 🔒
Render the configuration file to a dot file then convert it to an SVG and optionally opens it with inkscape.

Type Aliases§

CuResult
\ No newline at end of file diff --git a/cu29_rendercfg/struct.Args.html b/cu29_rendercfg/struct.Args.html index d6624644c..3bdac4181 100644 --- a/cu29_rendercfg/struct.Args.html +++ b/cu29_rendercfg/struct.Args.html @@ -1,4 +1,4 @@ -Args in cu29_rendercfg - Rust

Struct Args

Source
pub(crate) struct Args {
+Args in cu29_rendercfg - Rust

Struct Args

Source
pub(crate) struct Args {
     pub(crate) config: PathBuf,
     pub(crate) open: bool,
 }

Fields§

§config: PathBuf

Config file name

diff --git a/cu29_rendercfg/struct.CuError.html b/cu29_rendercfg/struct.CuError.html index 8f071f907..c497b62df 100644 --- a/cu29_rendercfg/struct.CuError.html +++ b/cu29_rendercfg/struct.CuError.html @@ -1,4 +1,4 @@ -CuError in cu29_rendercfg - Rust

Struct CuError

pub struct CuError {
+CuError in cu29_rendercfg - Rust

Struct CuError

pub struct CuError {
     pub(crate) message: String,
     pub(crate) cause: Option<String>,
 }
Expand description

Common copper Error type.

diff --git a/cu29_rendercfg/trait.CopperListTuple.html b/cu29_rendercfg/trait.CopperListTuple.html index 8f99bef96..df1bf6dc0 100644 --- a/cu29_rendercfg/trait.CopperListTuple.html +++ b/cu29_rendercfg/trait.CopperListTuple.html @@ -1,4 +1,4 @@ -CopperListTuple in cu29_rendercfg - Rust

Trait CopperListTuple

pub trait CopperListTuple:
+CopperListTuple in cu29_rendercfg - Rust

Trait CopperListTuple

pub trait CopperListTuple:
     Sized
     + Encode
     + Decode
diff --git a/cu29_rendercfg/trait.WriteStream.html b/cu29_rendercfg/trait.WriteStream.html
index 91f5f09bb..c1a115aec 100644
--- a/cu29_rendercfg/trait.WriteStream.html
+++ b/cu29_rendercfg/trait.WriteStream.html
@@ -1,4 +1,4 @@
-WriteStream in cu29_rendercfg - Rust

Trait WriteStream

pub trait WriteStream<E>:
+WriteStream in cu29_rendercfg - Rust

Trait WriteStream

pub trait WriteStream<E>:
     Sync
     + Send
     + Debug
where diff --git a/cu29_rendercfg/type.CuResult.html b/cu29_rendercfg/type.CuResult.html index 80bc07941..8b95cb59a 100644 --- a/cu29_rendercfg/type.CuResult.html +++ b/cu29_rendercfg/type.CuResult.html @@ -1,4 +1,4 @@ -CuResult in cu29_rendercfg - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
+CuResult in cu29_rendercfg - Rust

Type Alias CuResult

pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
     Ok(T),
     Err(CuError),
 }

Variants§

§1.0.0

Ok(T)

Contains the success value

diff --git a/cu29_runtime/all.html b/cu29_runtime/all.html index 887f2014a..cdd6f1a1c 100644 --- a/cu29_runtime/all.html +++ b/cu29_runtime/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_runtime/config/fn.read_configuration.html b/cu29_runtime/config/fn.read_configuration.html index 172040f4b..8c5108029 100644 --- a/cu29_runtime/config/fn.read_configuration.html +++ b/cu29_runtime/config/fn.read_configuration.html @@ -1,2 +1,2 @@ -read_configuration in cu29_runtime::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a file.

+read_configuration in cu29_runtime::config - Rust

Function read_configuration

Source
pub fn read_configuration(config_filename: &str) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a file.

\ No newline at end of file diff --git a/cu29_runtime/config/fn.read_configuration_str.html b/cu29_runtime/config/fn.read_configuration_str.html index 45c99f759..4fcc90531 100644 --- a/cu29_runtime/config/fn.read_configuration_str.html +++ b/cu29_runtime/config/fn.read_configuration_str.html @@ -1,2 +1,2 @@ -read_configuration_str in cu29_runtime::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(config_content: String) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a String.

+read_configuration_str in cu29_runtime::config - Rust

Function read_configuration_str

Source
pub fn read_configuration_str(config_content: String) -> CuResult<CuConfig>
Expand description

Read a copper configuration from a String.

\ No newline at end of file diff --git a/cu29_runtime/config/index.html b/cu29_runtime/config/index.html index a686a2e89..5bca57503 100644 --- a/cu29_runtime/config/index.html +++ b/cu29_runtime/config/index.html @@ -1,4 +1,4 @@ -cu29_runtime::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. +cu29_runtime::config - Rust

Module config

Source
Expand description

This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.

diff --git a/cu29_runtime/config/struct.Cnx.html b/cu29_runtime/config/struct.Cnx.html index 606cddb5d..ef0ca9c2f 100644 --- a/cu29_runtime/config/struct.Cnx.html +++ b/cu29_runtime/config/struct.Cnx.html @@ -1,4 +1,4 @@ -Cnx in cu29_runtime::config - Rust

Struct Cnx

Source
pub struct Cnx {
+Cnx in cu29_runtime::config - Rust

Struct Cnx

Source
pub struct Cnx {
     pub msg: String,
     pub batch: Option<u32>,
     pub store: Option<bool>,
diff --git a/cu29_runtime/config/struct.ComponentConfig.html b/cu29_runtime/config/struct.ComponentConfig.html
index 2f294a56b..bd5475c3e 100644
--- a/cu29_runtime/config/struct.ComponentConfig.html
+++ b/cu29_runtime/config/struct.ComponentConfig.html
@@ -1,4 +1,4 @@
-ComponentConfig in cu29_runtime::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w +ComponentConfig in cu29_runtime::config - Rust

Struct ComponentConfig

Source
pub struct ComponentConfig(pub HashMap<String, Value>);
Expand description

This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.

Tuple Fields§

§0: HashMap<String, Value>

Implementations§

Source§

impl ComponentConfig

Source

pub fn new() -> Self

Source

pub fn get<T: From<Value>>(&self, key: &str) -> Option<T>

Source

pub fn set<T: Into<Value>>(&mut self, key: &str, value: T)

Trait Implementations§

Source§

impl Clone for ComponentConfig

Source§

fn clone(&self) -> ComponentConfig

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 Debug for ComponentConfig

Source§

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

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

impl Default for ComponentConfig

Source§

fn default() -> ComponentConfig

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

impl<'de> Deserialize<'de> for ComponentConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where diff --git a/cu29_runtime/config/struct.CuConfig.html b/cu29_runtime/config/struct.CuConfig.html index 9105a0b32..935eae689 100644 --- a/cu29_runtime/config/struct.CuConfig.html +++ b/cu29_runtime/config/struct.CuConfig.html @@ -1,4 +1,4 @@ -CuConfig in cu29_runtime::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
+CuConfig in cu29_runtime::config - Rust

Struct CuConfig

Source
pub struct CuConfig {
     pub graph: StableDiGraph<Node, Cnx, NodeId>,
     pub monitor: Option<MonitorConfig>,
     pub logging: Option<LoggingConfig>,
diff --git a/cu29_runtime/config/struct.LoggingConfig.html b/cu29_runtime/config/struct.LoggingConfig.html
index 28d587e93..355d9081f 100644
--- a/cu29_runtime/config/struct.LoggingConfig.html
+++ b/cu29_runtime/config/struct.LoggingConfig.html
@@ -1,4 +1,4 @@
-LoggingConfig in cu29_runtime::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
+LoggingConfig in cu29_runtime::config - Rust

Struct LoggingConfig

Source
pub struct LoggingConfig {
     pub slab_size_mib: Option<u64>,
     pub section_size_mib: Option<u64>,
     pub enable_task_logging: bool,
diff --git a/cu29_runtime/config/struct.MonitorConfig.html b/cu29_runtime/config/struct.MonitorConfig.html
index 1c9d29fe7..c1b0d77e1 100644
--- a/cu29_runtime/config/struct.MonitorConfig.html
+++ b/cu29_runtime/config/struct.MonitorConfig.html
@@ -1,4 +1,4 @@
-MonitorConfig in cu29_runtime::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where +MonitorConfig in cu29_runtime::config - Rust

Struct MonitorConfig

Source
pub struct MonitorConfig { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for MonitorConfig

Source§

fn clone(&self) -> MonitorConfig

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 Debug for MonitorConfig

Source§

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

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

impl Default for MonitorConfig

Source§

fn default() -> MonitorConfig

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

impl<'de> Deserialize<'de> for MonitorConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MonitorConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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 diff --git a/cu29_runtime/config/struct.Node.html b/cu29_runtime/config/struct.Node.html index a674544be..b6378b8fe 100644 --- a/cu29_runtime/config/struct.Node.html +++ b/cu29_runtime/config/struct.Node.html @@ -1,4 +1,4 @@ -Node in cu29_runtime::config - Rust

Struct Node

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

A node in the configuration graph. +Node in cu29_runtime::config - Rust

Struct Node

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

A node in the configuration graph. A node represents a Task in the system Graph.

Implementations§

Source§

impl Node

Source

pub fn new(id: &str, ptype: &str) -> Self

Source

pub fn get_id(&self) -> String

Source

pub fn set_type(self, name: Option<String>) -> Self

Source

pub fn get_type(&self) -> &str

Source

pub fn get_instance_config(&self) -> Option<&ComponentConfig>

Source

pub fn get_param<T: From<Value>>(&self, key: &str) -> Option<T>

Source

pub fn set_param<T: Into<Value>>(&mut self, key: &str, value: T)

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

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 Debug for Node

Source§

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

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

impl<'de> Deserialize<'de> for Node

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Node

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where diff --git a/cu29_runtime/config/struct.Value.html b/cu29_runtime/config/struct.Value.html index c41812b76..e3fc94699 100644 --- a/cu29_runtime/config/struct.Value.html +++ b/cu29_runtime/config/struct.Value.html @@ -1,4 +1,4 @@ -Value in cu29_runtime::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

+Value in cu29_runtime::config - Rust

Struct Value

Source
pub struct Value(/* private fields */);
Expand description

Wrapper around the ron::Value to allow for custom serialization.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 Debug for Value

Source§

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

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

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Value

Source§

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

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

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for String

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for bool

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for f64

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for i32

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for u32

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for u8

Source§

fn from(value: Value) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> 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 Serialize for Value

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where diff --git a/cu29_runtime/config/type.NodeId.html b/cu29_runtime/config/type.NodeId.html index 0830818a1..9cd2a9b58 100644 --- a/cu29_runtime/config/type.NodeId.html +++ b/cu29_runtime/config/type.NodeId.html @@ -1,3 +1,3 @@ -NodeId in cu29_runtime::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph +NodeId in cu29_runtime::config - Rust

Type Alias NodeId

Source
pub type NodeId = u32;
Expand description

NodeId is the unique identifier of a node in the configuration graph for petgraph and the code generation.

\ No newline at end of file diff --git a/cu29_runtime/copperlist/enum.CopperListState.html b/cu29_runtime/copperlist/enum.CopperListState.html index 9adc5029a..7c278c89f 100644 --- a/cu29_runtime/copperlist/enum.CopperListState.html +++ b/cu29_runtime/copperlist/enum.CopperListState.html @@ -1,4 +1,4 @@ -CopperListState in cu29_runtime::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
+CopperListState in cu29_runtime::copperlist - Rust

Enum CopperListState

Source
pub enum CopperListState {
     Free,
     Initialized,
     Processing,
diff --git a/cu29_runtime/copperlist/index.html b/cu29_runtime/copperlist/index.html
index e3f906cbf..87f3f2470 100644
--- a/cu29_runtime/copperlist/index.html
+++ b/cu29_runtime/copperlist/index.html
@@ -1,4 +1,4 @@
-cu29_runtime::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. +cu29_runtime::copperlist - Rust

Module copperlist

Source
Expand description

CopperList is the main data structure used by Copper to communicate between tasks. It is a queue that can be used to store preallocated messages between tasks in memory order.

Structs§

CopperLiskMask
Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.
CopperList
CuListsManager
This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. diff --git a/cu29_runtime/copperlist/struct.CopperLiskMask.html b/cu29_runtime/copperlist/struct.CopperLiskMask.html index be5703e1b..cc71f9b3d 100644 --- a/cu29_runtime/copperlist/struct.CopperLiskMask.html +++ b/cu29_runtime/copperlist/struct.CopperLiskMask.html @@ -1,4 +1,4 @@ -CopperLiskMask in cu29_runtime::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. +CopperLiskMask in cu29_runtime::copperlist - Rust

Struct CopperLiskMask

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

Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for CopperLiskMask

Source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D, diff --git a/cu29_runtime/copperlist/struct.CopperList.html b/cu29_runtime/copperlist/struct.CopperList.html index f83521c84..007149201 100644 --- a/cu29_runtime/copperlist/struct.CopperList.html +++ b/cu29_runtime/copperlist/struct.CopperList.html @@ -1,4 +1,4 @@ -CopperList in cu29_runtime::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P: CopperListTuple> {
+CopperList in cu29_runtime::copperlist - Rust

Struct CopperList

Source
pub struct CopperList<P: CopperListTuple> {
     pub id: u32,
     pub msgs: P,
     /* private fields */
diff --git a/cu29_runtime/copperlist/struct.CuListsManager.html b/cu29_runtime/copperlist/struct.CuListsManager.html
index c016d2b66..ceb583771 100644
--- a/cu29_runtime/copperlist/struct.CuListsManager.html
+++ b/cu29_runtime/copperlist/struct.CuListsManager.html
@@ -1,4 +1,4 @@
-CuListsManager in cu29_runtime::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P: CopperListTuple, const N: usize> { /* private fields */ }
Expand description

This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. +CuListsManager in cu29_runtime::copperlist - Rust

Struct CuListsManager

Source
pub struct CuListsManager<P: CopperListTuple, const N: usize> { /* private fields */ }
Expand description

This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.

Implementations§

Source§

impl<P: CopperListTuple, const N: usize> CuListsManager<P, N>

Source

pub fn new() -> Self

Source

pub fn len(&self) -> usize

Returns the current number of elements in the queue.

diff --git a/cu29_runtime/copperlist/type.AscIter.html b/cu29_runtime/copperlist/type.AscIter.html index e4dd14b1f..921464763 100644 --- a/cu29_runtime/copperlist/type.AscIter.html +++ b/cu29_runtime/copperlist/type.AscIter.html @@ -1 +1 @@ -AscIter in cu29_runtime::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file +AscIter in cu29_runtime::copperlist - Rust

Type Alias AscIter

Source
pub type AscIter<'a, T> = Chain<Iter<'a, T>, Iter<'a, T>>;

Aliased Type§

struct AscIter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29_runtime/copperlist/type.AscIterMut.html b/cu29_runtime/copperlist/type.AscIterMut.html index 8fd94b7c5..bf43ab4ec 100644 --- a/cu29_runtime/copperlist/type.AscIterMut.html +++ b/cu29_runtime/copperlist/type.AscIterMut.html @@ -1 +1 @@ -AscIterMut in cu29_runtime::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file +AscIterMut in cu29_runtime::copperlist - Rust

Type Alias AscIterMut

Source
pub type AscIterMut<'a, T> = Chain<IterMut<'a, T>, IterMut<'a, T>>;

Aliased Type§

struct AscIterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29_runtime/copperlist/type.Iter.html b/cu29_runtime/copperlist/type.Iter.html index 6de830e41..693734cb1 100644 --- a/cu29_runtime/copperlist/type.Iter.html +++ b/cu29_runtime/copperlist/type.Iter.html @@ -1 +1 @@ -Iter in cu29_runtime::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file +Iter in cu29_runtime::copperlist - Rust

Type Alias Iter

Source
pub type Iter<'a, T> = Chain<Rev<Iter<'a, T>>, Rev<Iter<'a, T>>>;

Aliased Type§

struct Iter<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29_runtime/copperlist/type.IterMut.html b/cu29_runtime/copperlist/type.IterMut.html index 83c0bfae6..b3a6e357a 100644 --- a/cu29_runtime/copperlist/type.IterMut.html +++ b/cu29_runtime/copperlist/type.IterMut.html @@ -1 +1 @@ -IterMut in cu29_runtime::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file +IterMut in cu29_runtime::copperlist - Rust

Type Alias IterMut

Source
pub type IterMut<'a, T> = Chain<Rev<IterMut<'a, T>>, Rev<IterMut<'a, T>>>;

Aliased Type§

struct IterMut<'a, T> { /* private fields */ }
\ No newline at end of file diff --git a/cu29_runtime/curuntime/enum.CuExecutionUnit.html b/cu29_runtime/curuntime/enum.CuExecutionUnit.html index 3721c6a55..dc83debad 100644 --- a/cu29_runtime/curuntime/enum.CuExecutionUnit.html +++ b/cu29_runtime/curuntime/enum.CuExecutionUnit.html @@ -1,4 +1,4 @@ -CuExecutionUnit in cu29_runtime::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
+CuExecutionUnit in cu29_runtime::curuntime - Rust

Enum CuExecutionUnit

Source
pub enum CuExecutionUnit {
     Step(CuExecutionStep),
     Loop(CuExecutionLoop),
 }
Expand description

This structure represents a step in the execution plan.

diff --git a/cu29_runtime/curuntime/enum.CuTaskType.html b/cu29_runtime/curuntime/enum.CuTaskType.html index b0070e62a..bac56a3b6 100644 --- a/cu29_runtime/curuntime/enum.CuTaskType.html +++ b/cu29_runtime/curuntime/enum.CuTaskType.html @@ -1,4 +1,4 @@ -CuTaskType in cu29_runtime::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
+CuTaskType in cu29_runtime::curuntime - Rust

Enum CuTaskType

Source
pub enum CuTaskType {
     Source,
     Regular,
     Sink,
diff --git a/cu29_runtime/curuntime/fn.compute_runtime_plan.html b/cu29_runtime/curuntime/fn.compute_runtime_plan.html
index c48c55b96..d02e77236 100644
--- a/cu29_runtime/curuntime/fn.compute_runtime_plan.html
+++ b/cu29_runtime/curuntime/fn.compute_runtime_plan.html
@@ -1,3 +1,3 @@
-compute_runtime_plan in cu29_runtime::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(config: &CuConfig) -> CuResult<CuExecutionLoop>
Expand description

This is the main heuristics to compute an execution plan at compilation time. +compute_runtime_plan in cu29_runtime::curuntime - Rust

Function compute_runtime_plan

Source
pub fn compute_runtime_plan(config: &CuConfig) -> CuResult<CuExecutionLoop>
Expand description

This is the main heuristics to compute an execution plan at compilation time. TODO: Make that heuristic pluggable.

\ No newline at end of file diff --git a/cu29_runtime/curuntime/fn.find_task_type_for_id.html b/cu29_runtime/curuntime/fn.find_task_type_for_id.html index b1a66fcf1..559943395 100644 --- a/cu29_runtime/curuntime/fn.find_task_type_for_id.html +++ b/cu29_runtime/curuntime/fn.find_task_type_for_id.html @@ -1,4 +1,4 @@ -find_task_type_for_id in cu29_runtime::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
+find_task_type_for_id in cu29_runtime::curuntime - Rust

Function find_task_type_for_id

Source
pub fn find_task_type_for_id(
     graph: &StableDiGraph<Node, Cnx, NodeId>,
     node_id: NodeId,
 ) -> CuTaskType
\ No newline at end of file diff --git a/cu29_runtime/curuntime/index.html b/cu29_runtime/curuntime/index.html index c019db0af..d216b42f1 100644 --- a/cu29_runtime/curuntime/index.html +++ b/cu29_runtime/curuntime/index.html @@ -1,4 +1,4 @@ -cu29_runtime::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. +cu29_runtime::curuntime - Rust

Module curuntime

Source
Expand description

CuRuntime is the heart of what copper is running on the robot. It is exposed to the user via the copper_runtime macro injecting it as a field in their application struct.

Structs§

CopperContext
Just a simple struct to hold the various bits needed to run a Copper application.
CuExecutionLoop
This structure represents a loop in the execution plan. It is used to represent a sequence of Execution units (loop or steps) that are executed diff --git a/cu29_runtime/curuntime/struct.CopperContext.html b/cu29_runtime/curuntime/struct.CopperContext.html index 38a531bdf..496a3ea75 100644 --- a/cu29_runtime/curuntime/struct.CopperContext.html +++ b/cu29_runtime/curuntime/struct.CopperContext.html @@ -1,4 +1,4 @@ -CopperContext in cu29_runtime::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
+CopperContext in cu29_runtime::curuntime - Rust

Struct CopperContext

Source
pub struct CopperContext {
     pub unified_logger: Arc<Mutex<UnifiedLoggerWrite>>,
     pub logger_runtime: LoggerRuntime,
     pub clock: RobotClock,
diff --git a/cu29_runtime/curuntime/struct.CuExecutionLoop.html b/cu29_runtime/curuntime/struct.CuExecutionLoop.html
index 72c4bbe14..66a23cf84 100644
--- a/cu29_runtime/curuntime/struct.CuExecutionLoop.html
+++ b/cu29_runtime/curuntime/struct.CuExecutionLoop.html
@@ -1,4 +1,4 @@
-CuExecutionLoop in cu29_runtime::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
+CuExecutionLoop in cu29_runtime::curuntime - Rust

Struct CuExecutionLoop

Source
pub struct CuExecutionLoop {
     pub steps: Vec<CuExecutionUnit>,
     pub loop_count: Option<u32>,
 }
Expand description

This structure represents a loop in the execution plan. diff --git a/cu29_runtime/curuntime/struct.CuExecutionStep.html b/cu29_runtime/curuntime/struct.CuExecutionStep.html index 65bb764a3..3a4b6eed6 100644 --- a/cu29_runtime/curuntime/struct.CuExecutionStep.html +++ b/cu29_runtime/curuntime/struct.CuExecutionStep.html @@ -1,4 +1,4 @@ -CuExecutionStep in cu29_runtime::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
+CuExecutionStep in cu29_runtime::curuntime - Rust

Struct CuExecutionStep

Source
pub struct CuExecutionStep {
     pub node_id: NodeId,
     pub node: Node,
     pub task_type: CuTaskType,
diff --git a/cu29_runtime/curuntime/struct.CuRuntime.html b/cu29_runtime/curuntime/struct.CuRuntime.html
index a11284700..521442b51 100644
--- a/cu29_runtime/curuntime/struct.CuRuntime.html
+++ b/cu29_runtime/curuntime/struct.CuRuntime.html
@@ -1,4 +1,4 @@
-CuRuntime in cu29_runtime::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P: CopperListTuple, M: CuMonitor, const NBCL: usize> {
+CuRuntime in cu29_runtime::curuntime - Rust

Struct CuRuntime

Source
pub struct CuRuntime<CT, P: CopperListTuple, M: CuMonitor, const NBCL: usize> {
     pub tasks: CT,
     pub monitor: M,
     pub copper_lists_manager: CuListsManager<P, NBCL>,
diff --git a/cu29_runtime/cutask/index.html b/cu29_runtime/cutask/index.html
index 57f781c44..78c0f7d3d 100644
--- a/cu29_runtime/cutask/index.html
+++ b/cu29_runtime/cutask/index.html
@@ -1,4 +1,4 @@
-cu29_runtime::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement +cu29_runtime::cutask - Rust

Module cutask

Source
Expand description

This module contains all the main definition of the traits you need to implement or interact with to create a Copper task.

Structs§

CuCompactString
CuMsg
CuMsg is the envelope holding the msg payload and the metadata between tasks.
CuMsgMetadata
CuMsgMetadata is a structure that contains metadata common to all CuMsgs.

Traits§

CuMsgPack
CuMsgPayload
CuSinkTask
A Sink Task is a task that only consumes messages. For example drivers for actuators are Sink Tasks.
CuSrcTask
A Src Task is a task that only produces messages. For example drivers for sensors are Src Tasks. They are in push mode from the runtime. diff --git a/cu29_runtime/cutask/struct.CuCompactString.html b/cu29_runtime/cutask/struct.CuCompactString.html index 1c133b2d2..3afa8c7b6 100644 --- a/cu29_runtime/cutask/struct.CuCompactString.html +++ b/cu29_runtime/cutask/struct.CuCompactString.html @@ -1,4 +1,4 @@ -CuCompactString in cu29_runtime::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D: BorrowDecoder<'de>>( +CuCompactString in cu29_runtime::cutask - Rust

Struct CuCompactString

Source
pub struct CuCompactString(pub CompactString);

Tuple Fields§

§0: CompactString

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de> for CuCompactString

Source§

fn borrow_decode<D: BorrowDecoder<'de>>( decoder: &mut D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given BorrowDecode.
Source§

impl Clone for CuCompactString

Source§

fn clone(&self) -> CuCompactString

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 Debug for CuCompactString

Source§

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

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

impl Decode for CuCompactString

Source§

fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl Default for CuCompactString

Source§

fn default() -> CuCompactString

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

impl<'de> Deserialize<'de> for CuCompactString

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encode for CuCompactString

Source§

fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError>

Encode a given type.
Source§

impl PartialEq for CuCompactString

Source§

fn eq(&self, other: &CuCompactString) -> 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, diff --git a/cu29_runtime/cutask/struct.CuMsg.html b/cu29_runtime/cutask/struct.CuMsg.html index 294356d89..11c274f4d 100644 --- a/cu29_runtime/cutask/struct.CuMsg.html +++ b/cu29_runtime/cutask/struct.CuMsg.html @@ -1,4 +1,4 @@ -CuMsg in cu29_runtime::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where +CuMsg in cu29_runtime::cutask - Rust

Struct CuMsg

Source
pub struct CuMsg<T>
where T: CuMsgPayload,
{ pub metadata: CuMsgMetadata, /* private fields */ diff --git a/cu29_runtime/cutask/struct.CuMsgMetadata.html b/cu29_runtime/cutask/struct.CuMsgMetadata.html index 8b699bc49..2c8c6d0d3 100644 --- a/cu29_runtime/cutask/struct.CuMsgMetadata.html +++ b/cu29_runtime/cutask/struct.CuMsgMetadata.html @@ -1,4 +1,4 @@ -CuMsgMetadata in cu29_runtime::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
+CuMsgMetadata in cu29_runtime::cutask - Rust

Struct CuMsgMetadata

Source
pub struct CuMsgMetadata {
     pub process_time: PartialCuTimeRange,
     pub tov: Tov,
     pub status_txt: CuCompactString,
diff --git a/cu29_runtime/cutask/trait.CuMsgPack.html b/cu29_runtime/cutask/trait.CuMsgPack.html
index e86d11f60..ccf08f2a1 100644
--- a/cu29_runtime/cutask/trait.CuMsgPack.html
+++ b/cu29_runtime/cutask/trait.CuMsgPack.html
@@ -1 +1 @@
-CuMsgPack in cu29_runtime::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl, T4: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>, &'cl CuMsg<T4>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl, T4: CuMsgPayload + 'cl, T5: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>, &'cl CuMsg<T4>, &'cl CuMsg<T5>)

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for (&'cl CuMsg<T>,)

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for (&'cl mut CuMsg<T>,)

Implementors§

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for &'cl CuMsg<T>

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for &'cl mut CuMsg<T>

\ No newline at end of file +CuMsgPack in cu29_runtime::cutask - Rust

Trait CuMsgPack

Source
pub trait CuMsgPack<'cl> { }

Implementations on Foreign Types§

Source§

impl CuMsgPack<'_> for ()

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl, T4: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>, &'cl CuMsg<T4>)

Source§

impl<'cl, T1: CuMsgPayload + 'cl, T2: CuMsgPayload + 'cl, T3: CuMsgPayload + 'cl, T4: CuMsgPayload + 'cl, T5: CuMsgPayload + 'cl> CuMsgPack<'cl> for (&'cl CuMsg<T1>, &'cl CuMsg<T2>, &'cl CuMsg<T3>, &'cl CuMsg<T4>, &'cl CuMsg<T5>)

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for (&'cl CuMsg<T>,)

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for (&'cl mut CuMsg<T>,)

Implementors§

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for &'cl CuMsg<T>

Source§

impl<'cl, T: CuMsgPayload> CuMsgPack<'cl> for &'cl mut CuMsg<T>

\ No newline at end of file diff --git a/cu29_runtime/cutask/trait.CuMsgPayload.html b/cu29_runtime/cutask/trait.CuMsgPayload.html index 7ba9d9dd9..a1db8b771 100644 --- a/cu29_runtime/cutask/trait.CuMsgPayload.html +++ b/cu29_runtime/cutask/trait.CuMsgPayload.html @@ -1,4 +1,4 @@ -CuMsgPayload in cu29_runtime::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
+CuMsgPayload in cu29_runtime::cutask - Rust

Trait CuMsgPayload

Source
pub trait CuMsgPayload:
     Default
     + Debug
     + Clone
diff --git a/cu29_runtime/cutask/trait.CuSinkTask.html b/cu29_runtime/cutask/trait.CuSinkTask.html
index faf755778..bc30a52b4 100644
--- a/cu29_runtime/cutask/trait.CuSinkTask.html
+++ b/cu29_runtime/cutask/trait.CuSinkTask.html
@@ -1,4 +1,4 @@
-CuSinkTask in cu29_runtime::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
+CuSinkTask in cu29_runtime::cutask - Rust

Trait CuSinkTask

Source
pub trait CuSinkTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29_runtime/cutask/trait.CuSrcTask.html b/cu29_runtime/cutask/trait.CuSrcTask.html
index 0d63ac0a7..62cdbc084 100644
--- a/cu29_runtime/cutask/trait.CuSrcTask.html
+++ b/cu29_runtime/cutask/trait.CuSrcTask.html
@@ -1,4 +1,4 @@
-CuSrcTask in cu29_runtime::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
+CuSrcTask in cu29_runtime::cutask - Rust

Trait CuSrcTask

Source
pub trait CuSrcTask<'cl>: Freezable {
     type Output: CuMsgPack<'cl>;
 
     // Required methods
diff --git a/cu29_runtime/cutask/trait.CuTask.html b/cu29_runtime/cutask/trait.CuTask.html
index d3f25cb8b..007fb66d9 100644
--- a/cu29_runtime/cutask/trait.CuTask.html
+++ b/cu29_runtime/cutask/trait.CuTask.html
@@ -1,4 +1,4 @@
-CuTask in cu29_runtime::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
+CuTask in cu29_runtime::cutask - Rust

Trait CuTask

Source
pub trait CuTask<'cl>: Freezable {
     type Input: CuMsgPack<'cl>;
     type Output: CuMsgPack<'cl>;
 
diff --git a/cu29_runtime/cutask/trait.Freezable.html b/cu29_runtime/cutask/trait.Freezable.html
index 01135c9fa..d94241ec7 100644
--- a/cu29_runtime/cutask/trait.Freezable.html
+++ b/cu29_runtime/cutask/trait.Freezable.html
@@ -1,4 +1,4 @@
-Freezable in cu29_runtime::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
+Freezable in cu29_runtime::cutask - Rust

Trait Freezable

Source
pub trait Freezable {
     // Provided methods
     fn freeze<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError> { ... }
     fn thaw<D: Decoder>(&mut self, decoder: &mut D) -> Result<(), DecodeError> { ... }
diff --git a/cu29_runtime/index.html b/cu29_runtime/index.html
index 3c3a5fa05..f790457e7 100644
--- a/cu29_runtime/index.html
+++ b/cu29_runtime/index.html
@@ -1,4 +1,4 @@
-cu29_runtime - Rust

Crate cu29_runtime

Source
Expand description
logo +cu29_runtime - Rust

Crate cu29_runtime

Source
Expand description
logo

§

§Copper

copper GitHub last commit diff --git a/cu29_runtime/macro.input_msg.html b/cu29_runtime/macro.input_msg.html index ad30e6cbc..d8da03af5 100644 --- a/cu29_runtime/macro.input_msg.html +++ b/cu29_runtime/macro.input_msg.html @@ -1,4 +1,4 @@ -input_msg in cu29_runtime - Rust

Macro input_msg

Source
macro_rules! input_msg {
+input_msg in cu29_runtime - Rust

Macro input_msg

Source
macro_rules! input_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
     ($lifetime:lifetime, $($ty:ty),*) => { ... };
 }
\ No newline at end of file diff --git a/cu29_runtime/macro.output_msg.html b/cu29_runtime/macro.output_msg.html index e0f63afc7..c9ca056a3 100644 --- a/cu29_runtime/macro.output_msg.html +++ b/cu29_runtime/macro.output_msg.html @@ -1,3 +1,3 @@ -output_msg in cu29_runtime - Rust

Macro output_msg

Source
macro_rules! output_msg {
+output_msg in cu29_runtime - Rust

Macro output_msg

Source
macro_rules! output_msg {
     ($lifetime:lifetime, $ty:ty) => { ... };
 }
\ No newline at end of file diff --git a/cu29_runtime/monitoring/enum.CuTaskState.html b/cu29_runtime/monitoring/enum.CuTaskState.html index a822271d4..ba31b1c9a 100644 --- a/cu29_runtime/monitoring/enum.CuTaskState.html +++ b/cu29_runtime/monitoring/enum.CuTaskState.html @@ -1,4 +1,4 @@ -CuTaskState in cu29_runtime::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
+CuTaskState in cu29_runtime::monitoring - Rust

Enum CuTaskState

Source
pub enum CuTaskState {
     Start,
     Preprocess,
     Process,
diff --git a/cu29_runtime/monitoring/enum.Decision.html b/cu29_runtime/monitoring/enum.Decision.html
index 0bb6987ad..7d0ce589d 100644
--- a/cu29_runtime/monitoring/enum.Decision.html
+++ b/cu29_runtime/monitoring/enum.Decision.html
@@ -1,4 +1,4 @@
-Decision in cu29_runtime::monitoring - Rust

Enum Decision

Source
pub enum Decision {
+Decision in cu29_runtime::monitoring - Rust

Enum Decision

Source
pub enum Decision {
     Abort,
     Ignore,
     Shutdown,
diff --git a/cu29_runtime/monitoring/index.html b/cu29_runtime/monitoring/index.html
index ea52702f5..8176fe222 100644
--- a/cu29_runtime/monitoring/index.html
+++ b/cu29_runtime/monitoring/index.html
@@ -1,4 +1,4 @@
-cu29_runtime::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

+cu29_runtime::monitoring - Rust

Module monitoring

Source
Expand description

Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.

Structs§

CountingAllocator
A simple allocator that counts the number of bytes allocated and deallocated.
CuDurationStatistics
A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.
LiveStatistics
Accumulative stat object that can give your some real time statistics.
NoMonitor
A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.
ScopedAllocCounter
A simple struct that counts the number of bytes allocated and deallocated in a scope.

Enums§

CuTaskState
The state of a task.
Decision
Monitor decision to be taken when a task errored out.

Statics§

GLOBAL

Traits§

CuMonitor
Trait to implement a monitoring task.
\ No newline at end of file diff --git a/cu29_runtime/monitoring/static.GLOBAL.html b/cu29_runtime/monitoring/static.GLOBAL.html index b71b88e71..825021b0d 100644 --- a/cu29_runtime/monitoring/static.GLOBAL.html +++ b/cu29_runtime/monitoring/static.GLOBAL.html @@ -1 +1 @@ -GLOBAL in cu29_runtime::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file +GLOBAL in cu29_runtime::monitoring - Rust

Static GLOBAL

Source
pub static GLOBAL: CountingAllocator
\ No newline at end of file diff --git a/cu29_runtime/monitoring/struct.CountingAllocator.html b/cu29_runtime/monitoring/struct.CountingAllocator.html index 53e9ee689..7e8e87b5e 100644 --- a/cu29_runtime/monitoring/struct.CountingAllocator.html +++ b/cu29_runtime/monitoring/struct.CountingAllocator.html @@ -1,4 +1,4 @@ -CountingAllocator in cu29_runtime::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

+CountingAllocator in cu29_runtime::monitoring - Rust

Struct CountingAllocator

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

A simple allocator that counts the number of bytes allocated and deallocated.

Implementations§

Source§

impl CountingAllocator

Source

pub const fn new() -> Self

Source

pub fn get_allocated(&self) -> usize

Source

pub fn get_deallocated(&self) -> usize

Source

pub fn reset(&self)

Trait Implementations§

Source§

impl Default for CountingAllocator

Source§

fn default() -> Self

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

impl GlobalAlloc for CountingAllocator

Source§

unsafe fn alloc(&self, layout: Layout) -> *mut u8

Allocates memory as described by the given layout. Read more
Source§

unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)

Deallocates the block of memory at the given ptr pointer with the given layout. Read more
1.28.0 · Source§

unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8

Behaves like alloc, but also ensures that the contents are set to zero before being returned. Read more
1.28.0 · Source§

unsafe fn realloc( &self, diff --git a/cu29_runtime/monitoring/struct.CuDurationStatistics.html b/cu29_runtime/monitoring/struct.CuDurationStatistics.html index 89c1a27b5..f0d7be10d 100644 --- a/cu29_runtime/monitoring/struct.CuDurationStatistics.html +++ b/cu29_runtime/monitoring/struct.CuDurationStatistics.html @@ -1,4 +1,4 @@ -CuDurationStatistics in cu29_runtime::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. +CuDurationStatistics in cu29_runtime::monitoring - Rust

Struct CuDurationStatistics

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

A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.

Implementations§

Source§

impl CuDurationStatistics

Source

pub fn new(max: CuDuration) -> Self

Source

pub fn min(&self) -> CuDuration

Source

pub fn max(&self) -> CuDuration

Source

pub fn mean(&self) -> CuDuration

Source

pub fn percentile(&self, percentile: f64) -> CuDuration

Source

pub fn stddev(&self) -> CuDuration

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn jitter_min(&self) -> CuDuration

Source

pub fn jitter_max(&self) -> CuDuration

Source

pub fn jitter_mean(&self) -> CuDuration

Source

pub fn jitter_stddev(&self) -> CuDuration

Source

pub fn jitter_percentile(&self, percentile: f64) -> CuDuration

Source

pub fn record(&mut self, value: CuDuration)

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for CuDurationStatistics

Source§

fn clone(&self) -> CuDurationStatistics

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 Debug for CuDurationStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29_runtime/monitoring/struct.LiveStatistics.html b/cu29_runtime/monitoring/struct.LiveStatistics.html index 7b018dd88..ae6e34964 100644 --- a/cu29_runtime/monitoring/struct.LiveStatistics.html +++ b/cu29_runtime/monitoring/struct.LiveStatistics.html @@ -1,4 +1,4 @@ -LiveStatistics in cu29_runtime::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

+LiveStatistics in cu29_runtime::monitoring - Rust

Struct LiveStatistics

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

Accumulative stat object that can give your some real time statistics.

Implementations§

Source§

impl LiveStatistics

Source

pub fn new_unbounded() -> Self

Source

pub fn new_with_max(max: u64) -> Self

Source

pub fn min(&self) -> u64

Source

pub fn max(&self) -> u64

Source

pub fn mean(&self) -> f64

Source

pub fn percentile(&self, percentile: f64) -> u64

Source

pub fn record(&mut self, value: u64)

Adds a value to the statistics.

Source

pub fn len(&self) -> u64

Source

pub fn is_empty(&self) -> bool

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for LiveStatistics

Source§

fn clone(&self) -> LiveStatistics

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 Debug for LiveStatistics

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 diff --git a/cu29_runtime/monitoring/struct.NoMonitor.html b/cu29_runtime/monitoring/struct.NoMonitor.html index f28afdf27..ea3398f80 100644 --- a/cu29_runtime/monitoring/struct.NoMonitor.html +++ b/cu29_runtime/monitoring/struct.NoMonitor.html @@ -1,4 +1,4 @@ -NoMonitor in cu29_runtime::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. +NoMonitor in cu29_runtime::monitoring - Rust

Struct NoMonitor

Source
pub struct NoMonitor {}
Expand description

A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.

Trait Implementations§

Source§

impl CuMonitor for NoMonitor

Source§

fn new(_config: &CuConfig, _taskids: &'static [&'static str]) -> CuResult<Self>

Source§

fn process_copperlist(&self, _msgs: &[&CuMsgMetadata]) -> CuResult<()>

Callback that will be trigger at the end of every copperlist (before, on or after the serialization).
Source§

fn process_error( &self, diff --git a/cu29_runtime/monitoring/struct.ScopedAllocCounter.html b/cu29_runtime/monitoring/struct.ScopedAllocCounter.html index 609713b69..5a0e5a866 100644 --- a/cu29_runtime/monitoring/struct.ScopedAllocCounter.html +++ b/cu29_runtime/monitoring/struct.ScopedAllocCounter.html @@ -1,4 +1,4 @@ -ScopedAllocCounter in cu29_runtime::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

+ScopedAllocCounter in cu29_runtime::monitoring - Rust

Struct ScopedAllocCounter

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

A simple struct that counts the number of bytes allocated and deallocated in a scope.

Implementations§

Source§

impl ScopedAllocCounter

Source

pub fn new() -> Self

Source

pub fn get_allocated(&self) -> usize

Returns the total number of bytes allocated in the current scope since the creation of this ScopedAllocCounter.

§Example
diff --git a/cu29_runtime/monitoring/trait.CuMonitor.html b/cu29_runtime/monitoring/trait.CuMonitor.html index 208c64112..86c32b945 100644 --- a/cu29_runtime/monitoring/trait.CuMonitor.html +++ b/cu29_runtime/monitoring/trait.CuMonitor.html @@ -1,4 +1,4 @@ -CuMonitor in cu29_runtime::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
+CuMonitor in cu29_runtime::monitoring - Rust

Trait CuMonitor

Source
pub trait CuMonitor: Sized {
     // Required methods
     fn new(
         config: &CuConfig,
diff --git a/cu29_runtime/payload/index.html b/cu29_runtime/payload/index.html
index e7f91868b..3119dc8b3 100644
--- a/cu29_runtime/payload/index.html
+++ b/cu29_runtime/payload/index.html
@@ -1 +1 @@
-cu29_runtime::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file +cu29_runtime::payload - Rust

Module payload

Source

Structs§

CuArray
Copper friendly wrapper for a fixed size array.
\ No newline at end of file diff --git a/cu29_runtime/payload/struct.CuArray.html b/cu29_runtime/payload/struct.CuArray.html index b49751574..973abb7ba 100644 --- a/cu29_runtime/payload/struct.CuArray.html +++ b/cu29_runtime/payload/struct.CuArray.html @@ -1,4 +1,4 @@ -CuArray in cu29_runtime::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

+CuArray in cu29_runtime::payload - Rust

Struct CuArray

Source
pub struct CuArray<T, const N: usize> { /* private fields */ }
Expand description

Copper friendly wrapper for a fixed size array.

Implementations§

Source§

impl<T, const N: usize> CuArray<T, N>

Source

pub fn new() -> Self

Source

pub fn fill_from_iter<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn capacity(&self) -> usize

Trait Implementations§

Source§

impl<T: Clone, const N: usize> Clone for CuArray<T, N>

Source§

fn clone(&self) -> CuArray<T, N>

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<T: Debug, const N: usize> Debug for CuArray<T, N>

Source§

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

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

impl<T, const N: usize> Decode for CuArray<T, N>
where T: Decode,

Source§

fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl<T: Default, const N: usize> Default for CuArray<T, N>

Source§

fn default() -> CuArray<T, N>

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

impl<T, const N: usize> Encode for CuArray<T, N>
where diff --git a/cu29_runtime/pool/enum.CuHandleInner.html b/cu29_runtime/pool/enum.CuHandleInner.html index 2bfa936ee..9fdf215a6 100644 --- a/cu29_runtime/pool/enum.CuHandleInner.html +++ b/cu29_runtime/pool/enum.CuHandleInner.html @@ -1,4 +1,4 @@ -CuHandleInner in cu29_runtime::pool - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T: Debug> {
+CuHandleInner in cu29_runtime::pool - Rust

Enum CuHandleInner

Source
pub enum CuHandleInner<T: Debug> {
     Pooled(ReusableOwned<T>),
     Detached(T),
 }
Expand description

A Handle to a Buffer. @@ -549,7 +549,7 @@

§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);
-

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -566,10 +566,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -580,7 +582,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -596,7 +598,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -616,7 +618,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);

-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -634,7 +636,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -657,7 +659,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);

-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -680,7 +682,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -701,7 +703,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -713,7 +715,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -730,7 +732,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -757,7 +759,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -775,7 +777,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -793,7 +795,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);

-

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -812,7 +814,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -827,7 +829,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -843,7 +845,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -863,7 +865,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -882,7 +884,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);

-

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -905,7 +907,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -930,7 +932,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -955,7 +957,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);

-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -982,7 +984,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -997,7 +999,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1026,7 +1028,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1049,7 +1051,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1078,7 +1080,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-

1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1100,7 +1102,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1131,7 +1133,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1141,7 +1143,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1162,7 +1164,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1174,7 +1176,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1195,7 +1197,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);

-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1208,7 +1210,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1223,7 +1225,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1236,7 +1238,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);

-

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1252,7 +1254,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }

-

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1266,7 +1268,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);

-

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1280,7 +1282,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);

-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1294,7 +1296,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1309,7 +1311,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1324,7 +1326,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1339,7 +1341,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1357,7 +1359,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));

-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1371,7 +1373,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1426,7 +1428,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);

-

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1458,7 +1460,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });

-

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1492,7 +1494,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, });
-

1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1521,7 +1523,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1550,7 +1552,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1574,7 +1576,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1620,7 +1622,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1670,7 +1672,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1719,7 +1721,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1734,7 +1736,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1753,7 +1755,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1769,7 +1771,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1789,7 +1791,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1809,13 +1811,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1825,7 +1827,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1862,7 +1864,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1900,7 +1902,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1919,7 +1921,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1951,7 +1953,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1971,7 +1973,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1991,7 +1993,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2032,7 +2034,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2050,7 +2052,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2065,7 +2067,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2079,7 +2081,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2088,7 +2090,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2121,7 +2123,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2158,7 +2160,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2195,7 +2197,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2206,7 +2208,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2218,7 +2220,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2229,7 +2231,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2241,7 +2243,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2282,7 +2284,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2320,7 +2322,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2353,7 +2355,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2379,7 +2381,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2398,7 +2400,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2414,7 +2416,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2427,7 +2429,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2470,7 +2472,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2510,7 +2512,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2544,7 +2546,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2574,7 +2576,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2611,13 +2613,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2628,7 +2630,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2640,13 +2642,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2656,7 +2658,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2665,12 +2667,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29_runtime/pool/fn.pools_statistics.html b/cu29_runtime/pool/fn.pools_statistics.html index 87f977ca3..d2d9f3fe5 100644 --- a/cu29_runtime/pool/fn.pools_statistics.html +++ b/cu29_runtime/pool/fn.pools_statistics.html @@ -1,3 +1,3 @@ -pools_statistics in cu29_runtime::pool - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. +pools_statistics in cu29_runtime::pool - Rust

Function pools_statistics

Source
pub fn pools_statistics() -> SmallVec<[(ArrayString<64>, usize, usize, usize); 16]>
Expand description

Get the list of pools and their statistics. We use SmallVec here to avoid heap allocations while the stack is running.

\ No newline at end of file diff --git a/cu29_runtime/pool/index.html b/cu29_runtime/pool/index.html index dc9ef739d..805c83a0d 100644 --- a/cu29_runtime/pool/index.html +++ b/cu29_runtime/pool/index.html @@ -1,4 +1,4 @@ -cu29_runtime::pool - Rust

Module pool

Source

Structs§

AlignedBuffer
A buffer that is aligned to a specific size with the Element of type E.
CuHandle
A shareable handle to an Array coming from a pool (either host or device).
CuHostMemoryPool
A pool of host memory buffers.

Enums§

CuHandleInner
A Handle to a Buffer. +cu29_runtime::pool - Rust

Module pool

Source

Structs§

AlignedBuffer
A buffer that is aligned to a specific size with the Element of type E.
CuHandle
A shareable handle to an Array coming from a pool (either host or device).
CuHostMemoryPool
A pool of host memory buffers.

Enums§

CuHandleInner
A Handle to a Buffer. For onboard usages, the buffer should be Pooled (ie, coming from a preallocated pool). The Detached version is for offline usages where we don’t really need a pool to deserialize them.

Traits§

ArrayLike
CuPool
A CuPool is a pool of buffers that can be shared between different parts of the code. Handles can be stored locally in the tasks and shared between them.
DeviceCuPool
A device memory pool can copy data from a device to a host memory pool on top.
ElementType
Basic Type that can be used in a buffer in a CuPool.
PoolMonitor
Trait for a Pool to exposed to be monitored by the monitoring API.

Functions§

pools_statistics
Get the list of pools and their statistics. diff --git a/cu29_runtime/pool/struct.AlignedBuffer.html b/cu29_runtime/pool/struct.AlignedBuffer.html index 006d4c38f..5fd9c27be 100644 --- a/cu29_runtime/pool/struct.AlignedBuffer.html +++ b/cu29_runtime/pool/struct.AlignedBuffer.html @@ -1,4 +1,4 @@ -AlignedBuffer in cu29_runtime::pool - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E: ElementType> { /* private fields */ }
Expand description

A buffer that is aligned to a specific size with the Element of type E.

+AlignedBuffer in cu29_runtime::pool - Rust

Struct AlignedBuffer

Source
pub struct AlignedBuffer<E: ElementType> { /* private fields */ }
Expand description

A buffer that is aligned to a specific size with the Element of type E.

Implementations§

Source§

impl<E: ElementType> AlignedBuffer<E>

Source

pub fn new(num_elements: usize, alignment: usize) -> Self

Methods from Deref<Target = [E]>§

Source

pub fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
where T: Copy,

🔬This is a nightly-only experimental API. (maybe_uninit_write_slice)

Copies the elements from src to self, returning a mutable reference to the now initialized contents of self.

@@ -544,7 +544,7 @@
§Examples*elem += 2; } assert_eq!(x, &[3, 4, 6]);
-
1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · Source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

§Panics
@@ -561,10 +561,12 @@
§Examples
let slice = ['f', 'o', 'o'];
 let mut iter = slice.windows(4);
 assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

+

Because the Iterator trait cannot represent the required lifetimes, +there is no windows_mut analog to windows; +[0,1,2].windows_mut(2).collect() would violate the rules of references +(though a LendingIterator analog is possible). You can sometimes use +Cell::as_slice_of_cells in +conjunction with windows instead:

use std::cell::Cell;
 
@@ -575,7 +577,7 @@ 
§Examples&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -591,7 +593,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert_eq!(iter.next().unwrap(), &['m']); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · Source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -611,7 +613,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -629,7 +631,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -652,7 +654,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

§Safety

This may only be called when

@@ -675,7 +677,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -696,7 +698,7 @@
§Examplespanic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -708,7 +710,7 @@
§Exampleslet (remainder, chunks) = slice.as_rchunks(); assert_eq!(remainder, &['l']); assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be @@ -725,7 +727,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

Source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

@@ -752,7 +754,7 @@
§Examples// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-
Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -770,7 +772,7 @@
§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 9]);
-
Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

Source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

§Panics
@@ -788,7 +790,7 @@
§Examples1; } assert_eq!(v, &[9, 1, 1, 2, 2]);
-
Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

Source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and @@ -807,7 +809,7 @@

§Examples1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

Source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

@@ -822,7 +824,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -838,7 +840,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert_eq!(iter.next().unwrap(), &['l']); assert!(iter.next().is_none());
-
1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

@@ -858,7 +860,7 @@
§Examples1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · Source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -877,7 +879,7 @@

§Examplesassert_eq!(iter.next().unwrap(), &['o', 'r']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · Source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -900,7 +902,7 @@

§Examples1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -925,7 +927,7 @@

§Examplesassert_eq!(iter.next(), Some(&[2, 3][..])); assert_eq!(iter.next(), Some(&[2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where +

1.77.0 · Source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

The predicate is called for every pair of consecutive elements, @@ -950,7 +952,7 @@

§Examplesassert_eq!(iter.next(), Some(&mut [2, 3][..])); assert_eq!(iter.next(), Some(&mut [2, 3, 4][..])); assert_eq!(iter.next(), None);
-
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · Source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -977,7 +979,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -992,7 +994,7 @@
§Examples1] = 2; right[1] = 4; assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+
1.79.0 · Source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

@@ -1021,7 +1023,7 @@
§Examplesassert_eq!(left, ['a', 'b', 'c']); assert_eq!(right, []); }
-
1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( +

1.79.0 · Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize, ) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

@@ -1044,7 +1046,7 @@
§Examples1] = 4; } assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +

1.80.0 · Source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is too short.

If mid ≤ len returns a pair of slices where the first will contain all indices from [0, mid) (excluding the index mid itself) and the @@ -1073,7 +1075,7 @@

§Examplesassert_eq!(None, v.split_at_checked(7));
-
1.80.0 · Source

pub fn split_at_mut_checked( +

1.80.0 · Source

pub fn split_at_mut_checked( &mut self, mid: usize, ) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the @@ -1095,7 +1097,7 @@

§Examplesassert_eq!(v, [1, 2, 3, 4, 5, 6]); assert_eq!(None, v.split_at_mut_checked(7));
-
1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +

1.0.0 · Source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1126,7 +1128,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · Source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

§Examples
@@ -1136,7 +1138,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

@@ -1157,7 +1159,7 @@
§Examplesassert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · Source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

@@ -1169,7 +1171,7 @@
§Examples1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1190,7 +1192,7 @@
§Examplesassert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · Source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

@@ -1203,7 +1205,7 @@
§Examples0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · Source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1218,7 +1220,7 @@
§Examplesfor group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

@@ -1231,7 +1233,7 @@
§Examples0] = 1; } assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1247,7 +1249,7 @@

§Examplesfor group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · Source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in @@ -1261,7 +1263,7 @@

§Examples0] = 1; } assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1275,7 +1277,7 @@

§Examples&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

Source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix @@ -1289,7 +1291,7 @@

§Examples&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

@@ -1304,7 +1306,7 @@
§Examples
let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn starts_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1319,7 +1321,7 @@ 
§Examplesassert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where +

1.0.0 · Source

pub fn ends_with(&self, needle: &[T]) -> bool
where T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

§Examples
let v = [10, 40, 30];
@@ -1334,7 +1336,7 @@ 
§Examplesassert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. @@ -1352,7 +1354,7 @@

§Exampleslet prefix : &str = "he"; assert_eq!(b"hello".strip_prefix(prefix.as_bytes()), Some(b"llo".as_ref()));
-
1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · Source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. @@ -1366,7 +1368,7 @@

§Examplesassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..])); assert_eq!(v.strip_suffix(&[50]), None); assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1421,7 +1423,7 @@
§Exampless.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1453,7 +1455,7 @@

§Exampleslet seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, @@ -1487,7 +1489,7 @@

§Examplesassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · Source

pub fn sort_unstable(&mut self)
where +

1.20.0 · Source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

@@ -1516,7 +1518,7 @@
§Examplesassert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, without preserving the initial order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not @@ -1545,7 +1547,7 @@

§Examples// reverse sorting v.sort_unstable_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of equal elements.

@@ -1569,7 +1571,7 @@
§Examplesassert_eq!(v, [1, 2, -3, 4, -5]);
-
1.49.0 · Source

pub fn select_nth_unstable( +

1.49.0 · Source

pub fn select_nth_unstable( &mut self, index: usize, ) -> (&mut [T], &mut T, &mut [T])
where @@ -1615,7 +1617,7 @@
§Examples5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-

1.49.0 · Source

pub fn select_nth_unstable_by<F>( +

1.49.0 · Source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F, @@ -1665,7 +1667,7 @@

§Examples2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]); -
1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F, @@ -1714,7 +1716,7 @@

§Examples1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]); -
Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1729,7 +1731,7 @@

§Examplesassert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1748,7 +1750,7 @@

§Examplesassert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

Source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

@@ -1764,7 +1766,7 @@
§Examplesassert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · Source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front.

After calling rotate_left, the element previously at index mid will @@ -1784,7 +1786,7 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · Source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front.

After calling rotate_right, the element previously at index @@ -1804,13 +1806,13 @@

§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · Source

pub fn fill(&mut self, value: T)
where +

1.50.0 · Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default @@ -1820,7 +1822,7 @@

§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · Source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

§Panics
@@ -1857,7 +1859,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · Source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

@@ -1895,7 +1897,7 @@
§Examplesassert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · Source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1914,7 +1916,7 @@
§Examples1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · Source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

§Panics

This function will panic if the two slices have different lengths.

@@ -1946,7 +1948,7 @@
§Example
} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · Source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmutes the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1966,7 +1968,7 @@

§Examples}
-
1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · Source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmutes the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle slice of a new type, and the suffix slice. The middle part will be as big as possible under @@ -1986,7 +1988,7 @@

§Examples< // more_efficient_algorithm_for_aligned_shorts(shorts); // less_efficient_algorithm_for_bytes(suffix); }
-
Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

Source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Splits a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -2027,7 +2029,7 @@
§Examples< let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
Source

pub fn as_simd_mut<const LANES: usize>( +

Source

pub fn as_simd_mut<const LANES: usize>( &mut self, ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2045,7 +2047,7 @@
§Panics
supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where +

1.82.0 · Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

@@ -2060,7 +2062,7 @@
§Examples< assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare function to determine whether two elements are to be considered in sorted order.

@@ -2074,7 +2076,7 @@
§Examples< let empty: [i32; 0] = []; assert!(empty.is_sorted_by(|a, b| false)); assert!(empty.is_sorted_by(|a, b| true));
-
1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +

1.82.0 · Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the @@ -2083,7 +2085,7 @@

§Examples<
§Examples
assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2116,7 +2118,7 @@

§Examples< let idx = s.partition_point(|&x| x <= num); s.insert(idx, num); assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

Source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given @@ -2153,7 +2155,7 @@

§Examples< assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

Source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given @@ -2190,7 +2192,7 @@

§Examples< assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

Source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2201,7 +2203,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

Source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2213,7 +2215,7 @@
§Examples< assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

Source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

§Examples
@@ -2224,7 +2226,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

Source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

§Examples
@@ -2236,7 +2238,7 @@
§Examples< assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( +

Source

pub unsafe fn get_many_unchecked_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> [&mut <I as SliceIndex<[T]>>::Output; N]
where @@ -2277,7 +2279,7 @@
§Examples< b[0] = 1; } assert_eq!(x, &[1, 11, 111]);
-

Source

pub fn get_many_mut<I, const N: usize>( +

Source

pub fn get_many_mut<I, const N: usize>( &mut self, indices: [I; N], ) -> Result<[&mut <I as SliceIndex<[T]>>::Output; N], GetManyMutError>
where @@ -2315,7 +2317,7 @@
§Examples< b[0] = 1; } assert_eq!(v, &[1, 11, 111]);
-

Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

+
Source

pub fn element_offset(&self, element: &T) -> Option<usize>

🔬This is a nightly-only experimental API. (substr_range)

Returns the index that an element reference points to.

Returns None if element does not point to the start of an element within the slice.

This method is useful for extending slice iterators like slice::split.

Note that this uses pointer arithmetic and does not compare elements. @@ -2348,7 +2350,7 @@

§Examples< assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
-
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

+
Source

pub fn subslice_range(&self, subslice: &[T]) -> Option<Range<usize>>

🔬This is a nightly-only experimental API. (substr_range)

Returns the range of indices that a subslice points to.

Returns None if subslice does not point within the slice or if it is not aligned with the elements in the slice.

This method does not compare elements. Instead, this method finds the location in the slice that @@ -2374,7 +2376,7 @@

§Examples< assert_eq!(iter.next(), Some(1..3)); assert_eq!(iter.next(), Some(4..4)); assert_eq!(iter.next(), Some(5..6));
-
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
1.80.0 · Source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2393,7 +2395,7 @@

§Examples< let empty_slice_of_arrays: &[[u32; 10]] = &[]; assert!(empty_slice_of_arrays.as_flattened().is_empty());
-
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
1.80.0 · Source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

§Panics

This panics if the length of the resulting slice would overflow a usize.

This is only possible when flattening a slice of arrays of zero-sized @@ -2409,7 +2411,7 @@

§Examples< let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; add_5_to_all(array.as_flattened_mut()); assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f32::total_cmp.

§Current implementation
@@ -2422,7 +2424,7 @@
§Examples< let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN]; assert_eq!(&v[..8], &sorted[..8]); assert!(v[8].is_nan());
-
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+
Source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses the ordering defined by f64::total_cmp.

§Current implementation
@@ -2465,7 +2467,7 @@
§Examples< let expected = stringify!(c"\xFErris the 🦀\u{7}"); assert_eq!(lit, expected); }
-
1.0.0 · Source

pub fn sort(&mut self)
where +

1.0.0 · Source

pub fn sort(&mut self)
where T: Ord,

Sorts the slice, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2505,7 +2507,7 @@
§Examples< v.sort(); assert_eq!(v, [-5, -3, 1, 2, 4]);
-
1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where +

1.0.0 · Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparison function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) worst-case.

@@ -2539,7 +2541,7 @@
§Examples< // reverse sorting v.sort_by(|a, b| b.cmp(a)); assert_eq!(v, [4, 2, 1, -3, -5]);
-
1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where +

1.7.0 · Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) @@ -2569,7 +2571,7 @@

§Examples< v.sort_by_key(|k| k.abs()); assert_eq!(v, [1, 2, -3, 4, -5]);
-
1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where +

1.34.0 · Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * @@ -2606,13 +2608,13 @@

§Examples< // Strings are sorted by lexicographical order. v.sort_by_cached_key(|k| k.to_string()); assert_eq!(v, [-3, -5, 1, 10, 2, 4]);
-
1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where +

1.0.0 · Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
-
Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where +

Source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

§Examples
@@ -2623,7 +2625,7 @@
§Examples< let s = [10, 40, 30]; let x = s.to_vec_in(System); // Here, `s` and `x` can be modified independently.
-
1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where +

1.40.0 · Source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

§Panics

This function will panic if the capacity would overflow.

@@ -2635,13 +2637,13 @@
§Examples<
// this will panic at runtime
 b"0123456789abcdef".repeat(usize::MAX);
-
1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where +

1.0.0 · Source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
-
1.3.0 · Source

pub fn join<Separator>( +

1.3.0 · Source

pub fn join<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2651,7 +2653,7 @@
§Examples<
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
-

1.0.0 · Source

pub fn connect<Separator>( +

1.0.0 · Source

pub fn connect<Separator>( &self, sep: Separator, ) -> <[T] as Join<Separator>>::Output
where @@ -2660,12 +2662,12 @@
§Examples<
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.

To uppercase the value in-place, use make_ascii_uppercase.

-
1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +

1.23.0 · Source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII lower case equivalent.

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

diff --git a/cu29_runtime/pool/struct.CuHandle.html b/cu29_runtime/pool/struct.CuHandle.html index 748b09f73..b130a8827 100644 --- a/cu29_runtime/pool/struct.CuHandle.html +++ b/cu29_runtime/pool/struct.CuHandle.html @@ -1,4 +1,4 @@ -CuHandle in cu29_runtime::pool - Rust

Struct CuHandle

Source
pub struct CuHandle<T: ArrayLike>(/* private fields */);
Expand description

A shareable handle to an Array coming from a pool (either host or device).

+CuHandle in cu29_runtime::pool - Rust

Struct CuHandle

Source
pub struct CuHandle<T: ArrayLike>(/* private fields */);
Expand description

A shareable handle to an Array coming from a pool (either host or device).

Implementations§

Source§

impl<T: ArrayLike> CuHandle<T>

Source

pub fn new_detached(inner: T) -> Self

Create a new CuHandle not part of a Pool (not for onboard usages, use pools instead)

Source

pub fn with_inner<R>(&self, f: impl FnOnce(&CuHandleInner<T>) -> R) -> R

Safely access the inner value, applying a closure to it.

Source

pub fn with_inner_mut<R>(&self, f: impl FnOnce(&mut CuHandleInner<T>) -> R) -> R

Mutably access the inner value, applying a closure to it.

diff --git a/cu29_runtime/pool/struct.CuHostMemoryPool.html b/cu29_runtime/pool/struct.CuHostMemoryPool.html index 5211388a5..96bb88fc5 100644 --- a/cu29_runtime/pool/struct.CuHostMemoryPool.html +++ b/cu29_runtime/pool/struct.CuHostMemoryPool.html @@ -1,4 +1,4 @@ -CuHostMemoryPool in cu29_runtime::pool - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

+CuHostMemoryPool in cu29_runtime::pool - Rust

Struct CuHostMemoryPool

Source
pub struct CuHostMemoryPool<T> { /* private fields */ }
Expand description

A pool of host memory buffers.

Implementations§

Source§

impl<T: ArrayLike + 'static> CuHostMemoryPool<T>

Source

pub fn new<F>( id: &str, size: usize, diff --git a/cu29_runtime/pool/trait.ArrayLike.html b/cu29_runtime/pool/trait.ArrayLike.html index d10dfb5cb..9f4e45519 100644 --- a/cu29_runtime/pool/trait.ArrayLike.html +++ b/cu29_runtime/pool/trait.ArrayLike.html @@ -1,4 +1,4 @@ -ArrayLike in cu29_runtime::pool - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
+ArrayLike in cu29_runtime::pool - Rust

Trait ArrayLike

Source
pub trait ArrayLike:
     Deref<Target = [Self::Element]>
     + DerefMut
     + Debug
diff --git a/cu29_runtime/pool/trait.CuPool.html b/cu29_runtime/pool/trait.CuPool.html
index e54492ec9..884242f92 100644
--- a/cu29_runtime/pool/trait.CuPool.html
+++ b/cu29_runtime/pool/trait.CuPool.html
@@ -1,4 +1,4 @@
-CuPool in cu29_runtime::pool - Rust

Trait CuPool

Source
pub trait CuPool<T: ArrayLike>: PoolMonitor {
+CuPool in cu29_runtime::pool - Rust

Trait CuPool

Source
pub trait CuPool<T: ArrayLike>: PoolMonitor {
     // Required methods
     fn acquire(&self) -> Option<CuHandle<T>>;
     fn copy_from<O>(&self, from: &mut CuHandle<O>) -> CuHandle<T>
diff --git a/cu29_runtime/pool/trait.DeviceCuPool.html b/cu29_runtime/pool/trait.DeviceCuPool.html
index 3255b1ce7..13753c368 100644
--- a/cu29_runtime/pool/trait.DeviceCuPool.html
+++ b/cu29_runtime/pool/trait.DeviceCuPool.html
@@ -1,4 +1,4 @@
-DeviceCuPool in cu29_runtime::pool - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T: ArrayLike>: CuPool<T> {
+DeviceCuPool in cu29_runtime::pool - Rust

Trait DeviceCuPool

Source
pub trait DeviceCuPool<T: ArrayLike>: CuPool<T> {
     // Required method
     fn copy_to_host_pool<O>(
         &self,
diff --git a/cu29_runtime/pool/trait.ElementType.html b/cu29_runtime/pool/trait.ElementType.html
index 92cc481cb..edd4ef7a0 100644
--- a/cu29_runtime/pool/trait.ElementType.html
+++ b/cu29_runtime/pool/trait.ElementType.html
@@ -1,4 +1,4 @@
-ElementType in cu29_runtime::pool - Rust

Trait ElementType

Source
pub trait ElementType:
+ElementType in cu29_runtime::pool - Rust

Trait ElementType

Source
pub trait ElementType:
     Default
     + Sized
     + Copy
diff --git a/cu29_runtime/pool/trait.PoolMonitor.html b/cu29_runtime/pool/trait.PoolMonitor.html
index db2236a7a..5e2739fb9 100644
--- a/cu29_runtime/pool/trait.PoolMonitor.html
+++ b/cu29_runtime/pool/trait.PoolMonitor.html
@@ -1,4 +1,4 @@
-PoolMonitor in cu29_runtime::pool - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
+PoolMonitor in cu29_runtime::pool - Rust

Trait PoolMonitor

Source
pub trait PoolMonitor: Send + Sync {
     // Required methods
     fn id(&self) -> ArrayString<64>;
     fn space_left(&self) -> usize;
diff --git a/cu29_runtime/simulation/enum.CuTaskCallbackState.html b/cu29_runtime/simulation/enum.CuTaskCallbackState.html
index e29877b11..155868426 100644
--- a/cu29_runtime/simulation/enum.CuTaskCallbackState.html
+++ b/cu29_runtime/simulation/enum.CuTaskCallbackState.html
@@ -1,4 +1,4 @@
-CuTaskCallbackState in cu29_runtime::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where +CuTaskCallbackState in cu29_runtime::simulation - Rust

Enum CuTaskCallbackState

Source
pub enum CuTaskCallbackState<'cl, I, O>
where I: CuMsgPack<'cl>, O: CuMsgPack<'cl>,
{ New(Option<ComponentConfig>), diff --git a/cu29_runtime/simulation/enum.SimOverride.html b/cu29_runtime/simulation/enum.SimOverride.html index 056ebcf23..287d3b163 100644 --- a/cu29_runtime/simulation/enum.SimOverride.html +++ b/cu29_runtime/simulation/enum.SimOverride.html @@ -1,4 +1,4 @@ -SimOverride in cu29_runtime::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
+SimOverride in cu29_runtime::simulation - Rust

Enum SimOverride

Source
pub enum SimOverride {
     ExecutedBySim,
     ExecuteByRuntime,
     Errored(String),
diff --git a/cu29_runtime/simulation/index.html b/cu29_runtime/simulation/index.html
index d743de91d..23e838c8e 100644
--- a/cu29_runtime/simulation/index.html
+++ b/cu29_runtime/simulation/index.html
@@ -1,4 +1,4 @@
-cu29_runtime::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

+cu29_runtime::simulation - Rust

Module simulation

Source
Expand description

§cu29::simulation Module

The cu29::simulation module provides an interface to simulate tasks in Copper-based systems. It offers structures, traits, and enums that enable hooking into the lifecycle of tasks, adapting their behavior, and integrating them with simulated hardware environments.

diff --git a/cu29_runtime/simulation/struct.CuSimSinkTask.html b/cu29_runtime/simulation/struct.CuSimSinkTask.html index 81b9f12ac..e7583e186 100644 --- a/cu29_runtime/simulation/struct.CuSimSinkTask.html +++ b/cu29_runtime/simulation/struct.CuSimSinkTask.html @@ -1,4 +1,4 @@ -CuSimSinkTask in cu29_runtime::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. +CuSimSinkTask in cu29_runtime::simulation - Rust

Struct CuSimSinkTask

Source
pub struct CuSimSinkTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a sink task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T: CuMsgPayload + 'cl> CuSinkTask<'cl> for CuSimSinkTask<T>

Source§

type Input = &'cl CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> CuResult<Self>
where Self: Sized,

Here you need to initialize everything your task will need for the duration of its lifetime. diff --git a/cu29_runtime/simulation/struct.CuSimSrcTask.html b/cu29_runtime/simulation/struct.CuSimSrcTask.html index 0f8682d80..79aabad05 100644 --- a/cu29_runtime/simulation/struct.CuSimSrcTask.html +++ b/cu29_runtime/simulation/struct.CuSimSrcTask.html @@ -1,4 +1,4 @@ -CuSimSrcTask in cu29_runtime::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. +CuSimSrcTask in cu29_runtime::simulation - Rust

Struct CuSimSrcTask

Source
pub struct CuSimSrcTask<T> { /* private fields */ }
Expand description

This is a placeholder task for a source task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.

Trait Implementations§

Source§

impl<'cl, T: CuMsgPayload + 'cl> CuSrcTask<'cl> for CuSimSrcTask<T>

Source§

type Output = &'cl mut CuMsg<T>

Source§

fn new(_config: Option<&ComponentConfig>) -> CuResult<Self>
where Self: Sized,

Here you need to initialize everything your task will need for the duration of its lifetime. diff --git a/cu29_soa_derive/all.html b/cu29_soa_derive/all.html index 82f2dc4b7..13a90c0cd 100644 --- a/cu29_soa_derive/all.html +++ b/cu29_soa_derive/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Derive Macros

\ No newline at end of file +List of all items in this crate

List of all items

Derive Macros

\ No newline at end of file diff --git a/cu29_soa_derive/derive.Soa.html b/cu29_soa_derive/derive.Soa.html index ddf9c5ed8..d3047eaa5 100644 --- a/cu29_soa_derive/derive.Soa.html +++ b/cu29_soa_derive/derive.Soa.html @@ -1,4 +1,4 @@ -Soa in cu29_soa_derive - Rust

Derive Macro Soa

Source
#[derive(Soa)]
Expand description

Build a fixed sized SoA (Structure of Arrays) from a struct. +Soa in cu29_soa_derive - Rust

Derive Macro Soa

Source
#[derive(Soa)]
Expand description

Build a fixed sized SoA (Structure of Arrays) from a struct. The outputted SoA will be suitable for in place storage in messages and should be easier for the compiler to vectorize.

for example:

diff --git a/cu29_soa_derive/index.html b/cu29_soa_derive/index.html index 77aa78121..9b5ade4ae 100644 --- a/cu29_soa_derive/index.html +++ b/cu29_soa_derive/index.html @@ -1,3 +1,3 @@ -cu29_soa_derive - Rust

Crate cu29_soa_derive

Source

Derive Macros§

Soa
Build a fixed sized SoA (Structure of Arrays) from a struct. +cu29_soa_derive - Rust

Crate cu29_soa_derive

Source

Derive Macros§

Soa
Build a fixed sized SoA (Structure of Arrays) from a struct. The outputted SoA will be suitable for in place storage in messages and should be easier for the compiler to vectorize.
\ No newline at end of file diff --git a/cu29_traits/all.html b/cu29_traits/all.html index 7427820ce..736645997 100644 --- a/cu29_traits/all.html +++ b/cu29_traits/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/cu29_traits/enum.UnifiedLogType.html b/cu29_traits/enum.UnifiedLogType.html index be0a3edc3..c4855854d 100644 --- a/cu29_traits/enum.UnifiedLogType.html +++ b/cu29_traits/enum.UnifiedLogType.html @@ -1,4 +1,4 @@ -UnifiedLogType in cu29_traits - Rust

Enum UnifiedLogType

Source
pub enum UnifiedLogType {
+UnifiedLogType in cu29_traits - Rust

Enum UnifiedLogType

Source
pub enum UnifiedLogType {
     Empty,
     StructuredLogLine,
     CopperList,
diff --git a/cu29_traits/index.html b/cu29_traits/index.html
index 6171af30d..5cc916e97 100644
--- a/cu29_traits/index.html
+++ b/cu29_traits/index.html
@@ -1 +1 @@
-cu29_traits - Rust

Crate cu29_traits

Source

Structs§

CuError
Common copper Error type.

Enums§

UnifiedLogType
Defines the types of what can be logged in the unified logger.

Traits§

CopperListTuple
A CopperListTuple needs to be encodable, decodable and fixed size in memory.
WriteStream
Defines a basic write, append only stream trait to be able to log or send serializable objects.

Type Aliases§

CuResult
\ No newline at end of file +cu29_traits - Rust

Crate cu29_traits

Source

Structs§

CuError
Common copper Error type.

Enums§

UnifiedLogType
Defines the types of what can be logged in the unified logger.

Traits§

CopperListTuple
A CopperListTuple needs to be encodable, decodable and fixed size in memory.
WriteStream
Defines a basic write, append only stream trait to be able to log or send serializable objects.

Type Aliases§

CuResult
\ No newline at end of file diff --git a/cu29_traits/struct.CuError.html b/cu29_traits/struct.CuError.html index c03a64467..dcccab97d 100644 --- a/cu29_traits/struct.CuError.html +++ b/cu29_traits/struct.CuError.html @@ -1,4 +1,4 @@ -CuError in cu29_traits - Rust

Struct CuError

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

Common copper Error type.

+CuError in cu29_traits - Rust

Struct CuError

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

Common copper Error type.

Implementations§

Source§

impl CuError

Source

pub fn new_with_cause(message: &str, cause: impl Error) -> CuError

Source

pub fn add_cause(self, context: &str) -> CuError

Trait Implementations§

Source§

impl Clone for CuError

Source§

fn clone(&self) -> CuError

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 Debug for CuError

Source§

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

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

impl<'de> Deserialize<'de> for CuError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for CuError

Source§

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

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

impl Error for CuError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<&str> for CuError

Source§

fn from(s: &str) -> CuError

Converts to this type from the input type.
Source§

impl From<String> for CuError

Source§

fn from(s: String) -> CuError

Converts to this type from the input type.
Source§

impl Serialize for CuError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/cu29_traits/trait.CopperListTuple.html b/cu29_traits/trait.CopperListTuple.html index 1b32adea0..6c2aee91e 100644 --- a/cu29_traits/trait.CopperListTuple.html +++ b/cu29_traits/trait.CopperListTuple.html @@ -1,4 +1,4 @@ -CopperListTuple in cu29_traits - Rust

Trait CopperListTuple

Source
pub trait CopperListTuple:
+CopperListTuple in cu29_traits - Rust

Trait CopperListTuple

Source
pub trait CopperListTuple:
     Encode
     + Decode
     + Sized
diff --git a/cu29_traits/trait.WriteStream.html b/cu29_traits/trait.WriteStream.html
index 17993694c..d9fd3665e 100644
--- a/cu29_traits/trait.WriteStream.html
+++ b/cu29_traits/trait.WriteStream.html
@@ -1,4 +1,4 @@
-WriteStream in cu29_traits - Rust

Trait WriteStream

Source
pub trait WriteStream<E: Encode>:
+WriteStream in cu29_traits - Rust

Trait WriteStream

Source
pub trait WriteStream<E: Encode>:
     Sync
     + Send
     + Debug {
diff --git a/cu29_traits/type.CuResult.html b/cu29_traits/type.CuResult.html
index 58f7c9a9d..7502bebe8 100644
--- a/cu29_traits/type.CuResult.html
+++ b/cu29_traits/type.CuResult.html
@@ -1,4 +1,4 @@
-CuResult in cu29_traits - Rust

Type Alias CuResult

Source
pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
+CuResult in cu29_traits - Rust

Type Alias CuResult

Source
pub type CuResult<T> = Result<T, CuError>;

Aliased Type§

enum CuResult<T> {
     Ok(T),
     Err(CuError),
 }

Variants§

§1.0.0

Ok(T)

Contains the success value

diff --git a/cu29_unifiedlog/all.html b/cu29_unifiedlog/all.html index 67088d4d0..ade8164e5 100644 --- a/cu29_unifiedlog/all.html +++ b/cu29_unifiedlog/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/cu29_unifiedlog/enum.AllocatedSection.html b/cu29_unifiedlog/enum.AllocatedSection.html index c9e12f7eb..14c979727 100644 --- a/cu29_unifiedlog/enum.AllocatedSection.html +++ b/cu29_unifiedlog/enum.AllocatedSection.html @@ -1,4 +1,4 @@ -AllocatedSection in cu29_unifiedlog - Rust

Enum AllocatedSection

Source
pub enum AllocatedSection {
+AllocatedSection in cu29_unifiedlog - Rust

Enum AllocatedSection

Source
pub enum AllocatedSection {
     NoMoreSpace,
     Section(SectionHandle),
 }

Variants§

§

NoMoreSpace

§

Section(SectionHandle)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/cu29_unifiedlog/enum.UnifiedLogger.html b/cu29_unifiedlog/enum.UnifiedLogger.html index 9cb3b8d3a..90398ecc6 100644 --- a/cu29_unifiedlog/enum.UnifiedLogger.html +++ b/cu29_unifiedlog/enum.UnifiedLogger.html @@ -1,4 +1,4 @@ -UnifiedLogger in cu29_unifiedlog - Rust

Enum UnifiedLogger

Source
pub enum UnifiedLogger {
+UnifiedLogger in cu29_unifiedlog - Rust

Enum UnifiedLogger

Source
pub enum UnifiedLogger {
     Read(UnifiedLoggerRead),
     Write(UnifiedLoggerWrite),
 }
Expand description

Holder of the read or write side of the datalogger.

diff --git a/cu29_unifiedlog/fn.stream_write.html b/cu29_unifiedlog/fn.stream_write.html index 71b51d295..371013040 100644 --- a/cu29_unifiedlog/fn.stream_write.html +++ b/cu29_unifiedlog/fn.stream_write.html @@ -1,4 +1,4 @@ -stream_write in cu29_unifiedlog - Rust

Function stream_write

Source
pub fn stream_write<E: Encode>(
+stream_write in cu29_unifiedlog - Rust

Function stream_write

Source
pub fn stream_write<E: Encode>(
     logger: Arc<Mutex<UnifiedLoggerWrite>>,
     entry_type: UnifiedLogType,
     minimum_allocation_amount: usize,
diff --git a/cu29_unifiedlog/index.html b/cu29_unifiedlog/index.html
index 5f51a9ea8..4e73bddc4 100644
--- a/cu29_unifiedlog/index.html
+++ b/cu29_unifiedlog/index.html
@@ -1,4 +1,4 @@
-cu29_unifiedlog - Rust

Crate cu29_unifiedlog

Source

Structs§

SectionHandle
A SectionHandle is a handle to a section in the datalogger. +cu29_unifiedlog - Rust

Crate cu29_unifiedlog

Source

Structs§

SectionHandle
A SectionHandle is a handle to a section in the datalogger. It allows to track the lifecycle of a section of the datalogger.
SectionHeader
Each concurrent sublogger is tracked through a section header. They form a linked list of sections. The entry type is used to identify the type of data in the section.
UnifiedLoggerBuilder
Use this builder to create a new DataLogger.
UnifiedLoggerIOReader
This a convenience wrapper around the UnifiedLoggerRead to implement the Read trait.
UnifiedLoggerRead
A read side of the datalogger.
UnifiedLoggerWrite
A write side of the datalogger.

Enums§

AllocatedSection
UnifiedLogger
Holder of the read or write side of the datalogger.

Functions§

stream_write
Create a new stream to write to the unifiedlogger.
\ No newline at end of file diff --git a/cu29_unifiedlog/struct.SectionHandle.html b/cu29_unifiedlog/struct.SectionHandle.html index 2bc428a97..de0f82d42 100644 --- a/cu29_unifiedlog/struct.SectionHandle.html +++ b/cu29_unifiedlog/struct.SectionHandle.html @@ -1,4 +1,4 @@ -SectionHandle in cu29_unifiedlog - Rust

Struct SectionHandle

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

A SectionHandle is a handle to a section in the datalogger. +SectionHandle in cu29_unifiedlog - Rust

Struct SectionHandle

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

A SectionHandle is a handle to a section in the datalogger. It allows to track the lifecycle of a section of the datalogger.

Implementations§

Source§

impl SectionHandle

Source

pub fn create(section_header: SectionHeader, buffer: &'static mut [u8]) -> Self

Source

pub fn get_user_buffer(&mut self) -> &mut [u8]

Source

pub fn update_header(&mut self)

Trait Implementations§

Source§

impl Default for SectionHandle

Source§

fn default() -> SectionHandle

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

Auto Trait Implementations§

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 diff --git a/cu29_unifiedlog/struct.SectionHeader.html b/cu29_unifiedlog/struct.SectionHeader.html index fa8e4e218..9415fffdd 100644 --- a/cu29_unifiedlog/struct.SectionHeader.html +++ b/cu29_unifiedlog/struct.SectionHeader.html @@ -1,4 +1,4 @@ -SectionHeader in cu29_unifiedlog - Rust

Struct SectionHeader

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

Each concurrent sublogger is tracked through a section header. +SectionHeader in cu29_unifiedlog - Rust

Struct SectionHeader

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

Each concurrent sublogger is tracked through a section header. They form a linked list of sections. The entry type is used to identify the type of data in the section.

Trait Implementations§

Source§

impl<'__de> BorrowDecode<'__de> for SectionHeader

Source§

fn borrow_decode<__D: BorrowDecoder<'__de>>( diff --git a/cu29_unifiedlog/struct.UnifiedLoggerBuilder.html b/cu29_unifiedlog/struct.UnifiedLoggerBuilder.html index bc861ebb9..599649688 100644 --- a/cu29_unifiedlog/struct.UnifiedLoggerBuilder.html +++ b/cu29_unifiedlog/struct.UnifiedLoggerBuilder.html @@ -1,4 +1,4 @@ -UnifiedLoggerBuilder in cu29_unifiedlog - Rust

Struct UnifiedLoggerBuilder

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

Use this builder to create a new DataLogger.

+UnifiedLoggerBuilder in cu29_unifiedlog - Rust

Struct UnifiedLoggerBuilder

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

Use this builder to create a new DataLogger.

Implementations§

Source§

impl UnifiedLoggerBuilder

Source

pub fn new() -> Self

Source

pub fn file_base_name(self, file_path: &Path) -> Self

If “something/toto.copper” is given, it will find or create “something/toto_0.copper”, “something/toto_1.copper” etc.

Source

pub fn preallocated_size(self, preallocated_size: usize) -> Self

Source

pub fn write(self, write: bool) -> Self

Source

pub fn create(self, create: bool) -> Self

Source

pub fn build(self) -> Result<UnifiedLogger>

Trait Implementations§

Source§

impl Default for UnifiedLoggerBuilder

Source§

fn default() -> Self

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

Auto Trait Implementations§

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 diff --git a/cu29_unifiedlog/struct.UnifiedLoggerIOReader.html b/cu29_unifiedlog/struct.UnifiedLoggerIOReader.html index 9d320d913..1c2c6bdff 100644 --- a/cu29_unifiedlog/struct.UnifiedLoggerIOReader.html +++ b/cu29_unifiedlog/struct.UnifiedLoggerIOReader.html @@ -1,11 +1,11 @@ -UnifiedLoggerIOReader in cu29_unifiedlog - Rust

Struct UnifiedLoggerIOReader

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

This a convenience wrapper around the UnifiedLoggerRead to implement the Read trait.

+UnifiedLoggerIOReader in cu29_unifiedlog - Rust

Struct UnifiedLoggerIOReader

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

This a convenience wrapper around the UnifiedLoggerRead to implement the Read trait.

Implementations§

Source§

impl UnifiedLoggerIOReader

Source

pub fn new(logger: UnifiedLoggerRead, log_type: UnifiedLogType) -> Self

Trait Implementations§

Source§

impl Read for UnifiedLoggerIOReader

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Pull some bytes from this source into the specified buffer, returning -how many bytes were read. Read more
1.36.0 · Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored -implementation. Read more
1.0.0 · Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where - Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where - Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where +how many bytes were read. Read more

1.36.0 · Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored +implementation. Read more
1.0.0 · Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where + Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where R: Read, - Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where + Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more

Auto Trait Implementations§

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 diff --git a/cu29_unifiedlog/struct.UnifiedLoggerRead.html b/cu29_unifiedlog/struct.UnifiedLoggerRead.html index 1f36cd820..cb4d42ece 100644 --- a/cu29_unifiedlog/struct.UnifiedLoggerRead.html +++ b/cu29_unifiedlog/struct.UnifiedLoggerRead.html @@ -1,4 +1,4 @@ -UnifiedLoggerRead in cu29_unifiedlog - Rust

Struct UnifiedLoggerRead

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

A read side of the datalogger.

+UnifiedLoggerRead in cu29_unifiedlog - Rust

Struct UnifiedLoggerRead

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

A read side of the datalogger.

Implementations§

Source§

impl UnifiedLoggerRead

Source

pub fn new(base_file_path: &Path) -> Result<Self>

Source

pub fn read_next_section_type( &mut self, datalogtype: UnifiedLogType, diff --git a/cu29_unifiedlog/struct.UnifiedLoggerWrite.html b/cu29_unifiedlog/struct.UnifiedLoggerWrite.html index d80abf997..f7330de35 100644 --- a/cu29_unifiedlog/struct.UnifiedLoggerWrite.html +++ b/cu29_unifiedlog/struct.UnifiedLoggerWrite.html @@ -1,4 +1,4 @@ -UnifiedLoggerWrite in cu29_unifiedlog - Rust

Struct UnifiedLoggerWrite

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

A write side of the datalogger.

+UnifiedLoggerWrite in cu29_unifiedlog - Rust

Struct UnifiedLoggerWrite

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

A write side of the datalogger.

Implementations§

Source§

impl UnifiedLoggerWrite

Source

pub fn flush_section(&mut self, section: &mut SectionHandle)

Source

pub fn stats(&self) -> (usize, Vec<usize>, usize)

Trait Implementations§

Source§

impl Drop for UnifiedLoggerWrite

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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 diff --git a/help.html b/help.html index 064956ba7..5059e9d19 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -Help

Rustdoc help

Back
\ No newline at end of file +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/index.html b/index.html index 77c03aedd..0fdaa65bc 100644 --- a/index.html +++ b/index.html @@ -1,2 +1,2 @@ -Index of crates
+Index of crates
\ No newline at end of file diff --git a/settings.html b/settings.html index cfc53a650..97ecf215c 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Settings

Rustdoc settings

Back
\ No newline at end of file +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/cu29/lib.rs.html b/src/cu29/lib.rs.html index 947c02f64..be9329776 100644 --- a/src/cu29/lib.rs.html +++ b/src/cu29/lib.rs.html @@ -1,4 +1,4 @@ -lib.rs - source

cu29/
lib.rs

+lib.rs - source

cu29/
lib.rs

 1
 2
 3
diff --git a/src/cu29_clock/lib.rs.html b/src/cu29_clock/lib.rs.html
index a2772d685..16fc9a19f 100644
--- a/src/cu29_clock/lib.rs.html
+++ b/src/cu29_clock/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_clock/
lib.rs

+lib.rs - source

cu29_clock/
lib.rs

 1
 2
 3
diff --git a/src/cu29_derive/format.rs.html b/src/cu29_derive/format.rs.html
index a37e67cdd..0ade4e2d8 100644
--- a/src/cu29_derive/format.rs.html
+++ b/src/cu29_derive/format.rs.html
@@ -1,4 +1,4 @@
-format.rs - source

cu29_derive/
format.rs

+format.rs - source

cu29_derive/
format.rs

 1
 2
 3
diff --git a/src/cu29_derive/lib.rs.html b/src/cu29_derive/lib.rs.html
index 2554c285e..28c9758e8 100644
--- a/src/cu29_derive/lib.rs.html
+++ b/src/cu29_derive/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_derive/
lib.rs

+lib.rs - source

cu29_derive/
lib.rs

 1
 2
 3
diff --git a/src/cu29_derive/utils.rs.html b/src/cu29_derive/utils.rs.html
index 0cc44a3fb..a14ff33b6 100644
--- a/src/cu29_derive/utils.rs.html
+++ b/src/cu29_derive/utils.rs.html
@@ -1,4 +1,4 @@
-utils.rs - source

cu29_derive/
utils.rs

+utils.rs - source

cu29_derive/
utils.rs

 1
 2
 3
diff --git a/src/cu29_export/lib.rs.html b/src/cu29_export/lib.rs.html
index 0740366d7..bb969270c 100644
--- a/src/cu29_export/lib.rs.html
+++ b/src/cu29_export/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_export/
lib.rs

+lib.rs - source

cu29_export/
lib.rs

 1
 2
 3
diff --git a/src/cu29_helpers/lib.rs.html b/src/cu29_helpers/lib.rs.html
index 0b26a3ff3..cacbea204 100644
--- a/src/cu29_helpers/lib.rs.html
+++ b/src/cu29_helpers/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_helpers/
lib.rs

+lib.rs - source

cu29_helpers/
lib.rs

 1
 2
 3
diff --git a/src/cu29_intern_strs/lib.rs.html b/src/cu29_intern_strs/lib.rs.html
index 1750c47e7..84529204c 100644
--- a/src/cu29_intern_strs/lib.rs.html
+++ b/src/cu29_intern_strs/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_intern_strs/
lib.rs

+lib.rs - source

cu29_intern_strs/
lib.rs

 1
 2
 3
diff --git a/src/cu29_log/lib.rs.html b/src/cu29_log/lib.rs.html
index 5b5fca976..2443add4e 100644
--- a/src/cu29_log/lib.rs.html
+++ b/src/cu29_log/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_log/
lib.rs

+lib.rs - source

cu29_log/
lib.rs

 1
 2
 3
diff --git a/src/cu29_log_derive/index.rs.html b/src/cu29_log_derive/index.rs.html
index a6d10c1dc..29b81b503 100644
--- a/src/cu29_log_derive/index.rs.html
+++ b/src/cu29_log_derive/index.rs.html
@@ -1,4 +1,4 @@
-index.rs - source

cu29_log_derive/
index.rs

+index.rs - source

cu29_log_derive/
index.rs

 1
 2
 3
diff --git a/src/cu29_log_derive/lib.rs.html b/src/cu29_log_derive/lib.rs.html
index 926cfb44e..8f850d71e 100644
--- a/src/cu29_log_derive/lib.rs.html
+++ b/src/cu29_log_derive/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_log_derive/
lib.rs

+lib.rs - source

cu29_log_derive/
lib.rs

 1
 2
 3
diff --git a/src/cu29_log_runtime/lib.rs.html b/src/cu29_log_runtime/lib.rs.html
index 3ae7b9cea..3463da9b8 100644
--- a/src/cu29_log_runtime/lib.rs.html
+++ b/src/cu29_log_runtime/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_log_runtime/
lib.rs

+lib.rs - source

cu29_log_runtime/
lib.rs

 1
 2
 3
diff --git a/src/cu29_rendercfg/config.rs.html b/src/cu29_rendercfg/config.rs.html
index 261848ce3..bac95ebc1 100644
--- a/src/cu29_rendercfg/config.rs.html
+++ b/src/cu29_rendercfg/config.rs.html
@@ -1,4 +1,4 @@
-config.rs - source

cu29_rendercfg/
config.rs

+config.rs - source

cu29_rendercfg/
config.rs

 1
 2
 3
diff --git a/src/cu29_rendercfg/rendercfg.rs.html b/src/cu29_rendercfg/rendercfg.rs.html
index 7a4761fc4..9cd788d01 100644
--- a/src/cu29_rendercfg/rendercfg.rs.html
+++ b/src/cu29_rendercfg/rendercfg.rs.html
@@ -1,4 +1,4 @@
-rendercfg.rs - source

cu29_rendercfg/
rendercfg.rs

+rendercfg.rs - source

cu29_rendercfg/
rendercfg.rs

 1
 2
 3
diff --git a/src/cu29_runtime/config.rs.html b/src/cu29_runtime/config.rs.html
index c7ed7b3c3..755aca02c 100644
--- a/src/cu29_runtime/config.rs.html
+++ b/src/cu29_runtime/config.rs.html
@@ -1,4 +1,4 @@
-config.rs - source

cu29_runtime/
config.rs

+config.rs - source

cu29_runtime/
config.rs

 1
 2
 3
diff --git a/src/cu29_runtime/copperlist.rs.html b/src/cu29_runtime/copperlist.rs.html
index dd00024eb..12ae7b861 100644
--- a/src/cu29_runtime/copperlist.rs.html
+++ b/src/cu29_runtime/copperlist.rs.html
@@ -1,4 +1,4 @@
-copperlist.rs - source

cu29_runtime/
copperlist.rs

+copperlist.rs - source

cu29_runtime/
copperlist.rs

 1
 2
 3
diff --git a/src/cu29_runtime/curuntime.rs.html b/src/cu29_runtime/curuntime.rs.html
index fe171df3a..6e3b25bb0 100644
--- a/src/cu29_runtime/curuntime.rs.html
+++ b/src/cu29_runtime/curuntime.rs.html
@@ -1,4 +1,4 @@
-curuntime.rs - source

cu29_runtime/
curuntime.rs

+curuntime.rs - source

cu29_runtime/
curuntime.rs

 1
 2
 3
diff --git a/src/cu29_runtime/cutask.rs.html b/src/cu29_runtime/cutask.rs.html
index 096436f5f..7ccf38d1e 100644
--- a/src/cu29_runtime/cutask.rs.html
+++ b/src/cu29_runtime/cutask.rs.html
@@ -1,4 +1,4 @@
-cutask.rs - source

cu29_runtime/
cutask.rs

+cutask.rs - source

cu29_runtime/
cutask.rs

 1
 2
 3
diff --git a/src/cu29_runtime/lib.rs.html b/src/cu29_runtime/lib.rs.html
index 6598fe489..364def81e 100644
--- a/src/cu29_runtime/lib.rs.html
+++ b/src/cu29_runtime/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_runtime/
lib.rs

+lib.rs - source

cu29_runtime/
lib.rs

 1
 2
 3
diff --git a/src/cu29_runtime/log.rs.html b/src/cu29_runtime/log.rs.html
index 4c5c0e426..490269f68 100644
--- a/src/cu29_runtime/log.rs.html
+++ b/src/cu29_runtime/log.rs.html
@@ -1,4 +1,4 @@
-log.rs - source

cu29_runtime/
log.rs

+log.rs - source

cu29_runtime/
log.rs

 1
 2
 3
diff --git a/src/cu29_runtime/monitoring.rs.html b/src/cu29_runtime/monitoring.rs.html
index a99327266..d8a97908f 100644
--- a/src/cu29_runtime/monitoring.rs.html
+++ b/src/cu29_runtime/monitoring.rs.html
@@ -1,4 +1,4 @@
-monitoring.rs - source

cu29_runtime/
monitoring.rs

+monitoring.rs - source

cu29_runtime/
monitoring.rs

 1
 2
 3
diff --git a/src/cu29_runtime/payload.rs.html b/src/cu29_runtime/payload.rs.html
index 8d86ae0df..eb2d7063f 100644
--- a/src/cu29_runtime/payload.rs.html
+++ b/src/cu29_runtime/payload.rs.html
@@ -1,4 +1,4 @@
-payload.rs - source

cu29_runtime/
payload.rs

+payload.rs - source

cu29_runtime/
payload.rs

 1
 2
 3
diff --git a/src/cu29_runtime/pool.rs.html b/src/cu29_runtime/pool.rs.html
index 5a6361c82..09fac72dc 100644
--- a/src/cu29_runtime/pool.rs.html
+++ b/src/cu29_runtime/pool.rs.html
@@ -1,4 +1,4 @@
-pool.rs - source

cu29_runtime/
pool.rs

+pool.rs - source

cu29_runtime/
pool.rs

 1
 2
 3
diff --git a/src/cu29_runtime/simulation.rs.html b/src/cu29_runtime/simulation.rs.html
index dd27510d3..7a6afeebd 100644
--- a/src/cu29_runtime/simulation.rs.html
+++ b/src/cu29_runtime/simulation.rs.html
@@ -1,4 +1,4 @@
-simulation.rs - source

cu29_runtime/
simulation.rs

+simulation.rs - source

cu29_runtime/
simulation.rs

 1
 2
 3
diff --git a/src/cu29_soa_derive/format.rs.html b/src/cu29_soa_derive/format.rs.html
index 7408ac608..ec58a6317 100644
--- a/src/cu29_soa_derive/format.rs.html
+++ b/src/cu29_soa_derive/format.rs.html
@@ -1,4 +1,4 @@
-format.rs - source

cu29_soa_derive/
format.rs

+format.rs - source

cu29_soa_derive/
format.rs

 1
 2
 3
diff --git a/src/cu29_soa_derive/lib.rs.html b/src/cu29_soa_derive/lib.rs.html
index 09fca2e38..56f75219c 100644
--- a/src/cu29_soa_derive/lib.rs.html
+++ b/src/cu29_soa_derive/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_soa_derive/
lib.rs

+lib.rs - source

cu29_soa_derive/
lib.rs

 1
 2
 3
diff --git a/src/cu29_traits/lib.rs.html b/src/cu29_traits/lib.rs.html
index 07085c5e4..eb5e8bda4 100644
--- a/src/cu29_traits/lib.rs.html
+++ b/src/cu29_traits/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_traits/
lib.rs

+lib.rs - source

cu29_traits/
lib.rs

 1
 2
 3
diff --git a/src/cu29_unifiedlog/lib.rs.html b/src/cu29_unifiedlog/lib.rs.html
index 064ad4a4f..4c08e7eb5 100644
--- a/src/cu29_unifiedlog/lib.rs.html
+++ b/src/cu29_unifiedlog/lib.rs.html
@@ -1,4 +1,4 @@
-lib.rs - source

cu29_unifiedlog/
lib.rs

+lib.rs - source

cu29_unifiedlog/
lib.rs

 1
 2
 3
diff --git a/static.files/main-5f194d8c.js b/static.files/main-5f194d8c.js
deleted file mode 100644
index 3d672cb6e..000000000
--- a/static.files/main-5f194d8c.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden");const toggle=document.getElementById("toggle-all-docs");if(toggle){toggle.setAttribute("disabled","disabled")}}function showMain(){const main=document.getElementById(MAIN_ID);removeClass(main,"hidden");const mainHeading=main.querySelector(".main-heading");if(mainHeading&&searchState.rustdocToolbar){if(searchState.rustdocToolbar.parentElement){searchState.rustdocToolbar.parentElement.removeChild(searchState.rustdocToolbar)}mainHeading.appendChild(searchState.rustdocToolbar)}const toggle=document.getElementById("toggle-all-docs");if(toggle){toggle.removeAttribute("disabled")}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden");const mainHeading=elemToDisplay.querySelector(".main-heading");if(mainHeading&&searchState.rustdocToolbar){if(searchState.rustdocToolbar.parentElement){searchState.rustdocToolbar.parentElement.removeChild(searchState.rustdocToolbar)}mainHeading.appendChild(searchState.rustdocToolbar)}}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}if(getSettingsButton()){getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)}}window.searchState={rustdocToolbar:document.querySelector("rustdoc-toolbar"),loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElems=document.querySelectorAll(`details > summary > section[id^="${implId}"]`,);onEachLazy(implElems,implElem=>{const numbered=/^(.+?)-([0-9]+)$/.exec(implElem.id);if(implElem.id!==implId&&(!numbered||numbered[1]!==implId)){return false}return onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/^(.+?)-([0-9]+)$/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0);return true}},)})}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementById("rustdoc-modnav");function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;link.textContent=name;const li=document.createElement("li");if(link.href===current_page){li.classList.add("current")}li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementById("rustdoc-modnav");if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.children[0].innerText="Summary"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.children[0].innerText="Show all"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{if(document.querySelector(".rustdoc.src")){return}onEachLazy(document.querySelectorAll(":not(.scraped-example) > .example-wrap > pre:not(.example-line-numbers)",),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.querySelectorAll(".example-wrap > .example-line-numbers"),x=>{x.parentNode.removeChild(x)})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";document.body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}document.body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){if(!getHelpButton().contains(document.activeElement)&&!getHelpButton().contains(event.relatedTarget)&&!getSettingsButton().contains(document.activeElement)&&!getSettingsButton().contains(event.relatedTarget)){window.hidePopoverMenus()}}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ -the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ - restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ - enum, trait, type, macro, \ - and const.","Search functions by type signature (e.g., vec -> usize or \ - -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for functions that accept or return \ - slices and \ - arrays by writing \ - square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll("rustdoc-toolbar .popover"),elem=>{elem.style.display="none"});const button=getHelpButton();if(button){removeClass(button,"help-open")}};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){const button=getHelpButton();addClass(button,"help-open");button.querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}const helpLink=document.querySelector(`#${HELP_BUTTON_ID} > a`);if(isHelpPage){buildHelpMenu()}else if(helpLink){helpLink.addEventListener("click",event=>{if(!helpLink.contains(helpLink)||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){function copyContentToClipboard(content){const el=document.createElement("textarea");el.value=content;el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el)}function copyButtonAnimation(button){button.classList.add("clicked");if(button.reset_button_timeout!==undefined){window.clearTimeout(button.reset_button_timeout)}button.reset_button_timeout=window.setTimeout(()=>{button.reset_button_timeout=undefined;button.classList.remove("clicked")},1000)}const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const title=document.querySelector("title").textContent.replace(" - Rust","");const[item,module]=title.split(" in ");const path=[item];if(module!==undefined){path.unshift(module)}copyContentToClipboard(path.join("::"));copyButtonAnimation(but)};function copyCode(codeElem){if(!codeElem){return}copyContentToClipboard(codeElem.textContent)}function getExampleWrap(event){let elem=event.target;while(!hasClass(elem,"example-wrap")){if(elem===document.body||elem.tagName==="A"||elem.tagName==="BUTTON"||hasClass(elem,"docblock")){return null}elem=elem.parentElement}return elem}function addCopyButton(event){const elem=getExampleWrap(event);if(elem===null){return}elem.removeEventListener("mouseover",addCopyButton);const parent=document.createElement("div");parent.className="button-holder";const runButton=elem.querySelector(".test-arrow");if(runButton!==null){parent.appendChild(runButton)}elem.appendChild(parent);const copyButton=document.createElement("button");copyButton.className="copy-button";copyButton.title="Copy code to clipboard";copyButton.addEventListener("click",()=>{copyCode(elem.querySelector("pre > code"));copyButtonAnimation(copyButton)});parent.appendChild(copyButton);if(!elem.parentElement.classList.contains("scraped-example")){return}const scrapedWrapped=elem.parentElement;window.updateScrapedExample(scrapedWrapped,parent)}function showHideCodeExampleButtons(event){const elem=getExampleWrap(event);if(elem===null){return}let buttons=elem.querySelector(".button-holder");if(buttons===null){addCopyButton(event);buttons=elem.querySelector(".button-holder");if(buttons===null){return}}buttons.classList.toggle("keep-visible")}onEachLazy(document.querySelectorAll(".docblock .example-wrap"),elem=>{elem.addEventListener("mouseover",addCopyButton);elem.addEventListener("click",showHideCodeExampleButtons)})}()) \ No newline at end of file diff --git a/static.files/main-9b5d7e41.js b/static.files/main-9b5d7e41.js new file mode 100644 index 000000000..1f9c93d4f --- /dev/null +++ b/static.files/main-9b5d7e41.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden");const toggle=document.getElementById("toggle-all-docs");if(toggle){toggle.setAttribute("disabled","disabled")}}function showMain(){const main=document.getElementById(MAIN_ID);if(!main){return}removeClass(main,"hidden");const mainHeading=main.querySelector(".main-heading");if(mainHeading&&window.searchState.rustdocToolbar){if(window.searchState.rustdocToolbar.parentElement){window.searchState.rustdocToolbar.parentElement.removeChild(window.searchState.rustdocToolbar,)}mainHeading.appendChild(window.searchState.rustdocToolbar)}const toggle=document.getElementById("toggle-all-docs");if(toggle){toggle.removeAttribute("disabled")}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden");const mainHeading=elemToDisplay.querySelector(".main-heading");if(mainHeading&&searchState.rustdocToolbar){if(searchState.rustdocToolbar.parentElement){searchState.rustdocToolbar.parentElement.removeChild(searchState.rustdocToolbar)}mainHeading.appendChild(searchState.rustdocToolbar)}}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}if(getSettingsButton()){getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)}}window.searchState={rustdocToolbar:document.querySelector("rustdoc-toolbar"),loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(window.searchState.timeout!==null){clearTimeout(window.searchState.timeout);window.searchState.timeout=null}},isDisplayed:()=>{const outputElement=window.searchState.outputElement();return outputElement&&outputElement.parentElement&&outputElement.parentElement.id===ALTERNATIVE_DISPLAY_ID},focus:()=>{window.searchState.input&&window.searchState.input.focus()},defocus:()=>{window.searchState.input&&window.searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=window.searchState.outputElement()}switchDisplayedElement(search);window.searchState.mouseMovedAfterSearch=false;document.title=window.searchState.title},removeQueryParameters:()=>{document.title=window.searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);window.searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=window.searchState.input;if(!search_input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{window.searchState.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=window.searchState.getQueryStringParams();if(params.search!==undefined){window.searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=window.searchState.outputElement();if(!search){return}search.innerHTML="

"+window.searchState.loadingText+"

";window.searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&window.searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElems=document.querySelectorAll(`details > summary > section[id^="${implId}"]`,);onEachLazy(implElems,implElem=>{const numbered=/^(.+?)-([0-9]+)$/.exec(implElem.id);if(implElem.id!==implId&&(!numbered||numbered[1]!==implId)){return false}return onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/^(.+?)-([0-9]+)$/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0);return true}},)})}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementById("rustdoc-modnav");function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;link.textContent=name;const li=document.createElement("li");if(link.href===current_page){li.classList.add("current")}li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementById("rustdoc-modnav");if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.children[0].innerText="Summary"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.children[0].innerText="Show all"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{if(document.querySelector(".rustdoc.src")){return}onEachLazy(document.querySelectorAll(":not(.scraped-example) > .example-wrap > pre:not(.example-line-numbers)",),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.querySelectorAll(".example-wrap > .example-line-numbers"),x=>{x.parentNode.removeChild(x)})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{const ttl=e.getAttribute("title");if(ttl!==null){e.setAttribute("data-title",ttl);e.removeAttribute("title")}const dttl=e.getAttribute("data-title");if(dttl!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(dttl));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";document.body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"||!(ev.relatedTarget instanceof HTMLElement)){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}document.body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){if(!getHelpButton().contains(document.activeElement)&&!getHelpButton().contains(event.relatedTarget)&&!getSettingsButton().contains(document.activeElement)&&!getSettingsButton().contains(event.relatedTarget)){window.hidePopoverMenus()}}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll("rustdoc-toolbar .popover"),elem=>{elem.style.display="none"});const button=getHelpButton();if(button){removeClass(button,"help-open")}};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){const button=getHelpButton();addClass(button,"help-open");button.querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}const helpLink=document.querySelector(`#${HELP_BUTTON_ID} > a`);if(isHelpPage){buildHelpMenu()}else if(helpLink){helpLink.addEventListener("click",event=>{if(!helpLink.contains(helpLink)||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){function copyContentToClipboard(content){const el=document.createElement("textarea");el.value=content;el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el)}function copyButtonAnimation(button){button.classList.add("clicked");if(button.reset_button_timeout!==undefined){window.clearTimeout(button.reset_button_timeout)}button.reset_button_timeout=window.setTimeout(()=>{button.reset_button_timeout=undefined;button.classList.remove("clicked")},1000)}const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const title=document.querySelector("title").textContent.replace(" - Rust","");const[item,module]=title.split(" in ");const path=[item];if(module!==undefined){path.unshift(module)}copyContentToClipboard(path.join("::"));copyButtonAnimation(but)};function copyCode(codeElem){if(!codeElem){return}copyContentToClipboard(codeElem.textContent)}function getExampleWrap(event){let elem=event.target;while(!hasClass(elem,"example-wrap")){if(elem===document.body||elem.tagName==="A"||elem.tagName==="BUTTON"||hasClass(elem,"docblock")){return null}elem=elem.parentElement}return elem}function addCopyButton(event){const elem=getExampleWrap(event);if(elem===null){return}elem.removeEventListener("mouseover",addCopyButton);const parent=document.createElement("div");parent.className="button-holder";const runButton=elem.querySelector(".test-arrow");if(runButton!==null){parent.appendChild(runButton)}elem.appendChild(parent);const copyButton=document.createElement("button");copyButton.className="copy-button";copyButton.title="Copy code to clipboard";copyButton.addEventListener("click",()=>{copyCode(elem.querySelector("pre > code"));copyButtonAnimation(copyButton)});parent.appendChild(copyButton);if(!elem.parentElement.classList.contains("scraped-example")){return}const scrapedWrapped=elem.parentElement;window.updateScrapedExample(scrapedWrapped,parent)}function showHideCodeExampleButtons(event){const elem=getExampleWrap(event);if(elem===null){return}let buttons=elem.querySelector(".button-holder");if(buttons===null){addCopyButton(event);buttons=elem.querySelector(".button-holder");if(buttons===null){return}}buttons.classList.toggle("keep-visible")}onEachLazy(document.querySelectorAll(".docblock .example-wrap"),elem=>{elem.addEventListener("mouseover",addCopyButton);elem.addEventListener("click",showHideCodeExampleButtons)})}()) \ No newline at end of file diff --git a/static.files/scrape-examples-d508a8a9.js b/static.files/scrape-examples-2ea993ec.js similarity index 100% rename from static.files/scrape-examples-d508a8a9.js rename to static.files/scrape-examples-2ea993ec.js diff --git a/static.files/search-2d513d54.js b/static.files/search-2d513d54.js new file mode 100644 index 000000000..b790b6384 --- /dev/null +++ b/static.files/search-2d513d54.js @@ -0,0 +1,6 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}function onEachBtwn(arr,func,funcBtwn){let skipped=true;for(const value of arr){if(!skipped){funcBtwn(value)}skipped=func(value)}}const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_GENERIC=itemTypes.indexOf("generic");const TY_IMPORT=itemTypes.indexOf("import");const TY_TRAIT=itemTypes.indexOf("trait");const TY_FN=itemTypes.indexOf("fn");const TY_METHOD=itemTypes.indexOf("method");const TY_TYMETHOD=itemTypes.indexOf("tymethod");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";const UNBOXING_LIMIT=5;const REGEX_IDENT=/\p{ID_Start}\p{ID_Continue}*|_\p{ID_Continue}+/uy;const REGEX_INVALID_TYPE_FILTER=/[^a-z]/ui;const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function isFnLikeTy(ty){return ty===TY_FN||ty===TY_METHOD||ty===TY_TYMETHOD}function isSeparatorCharacter(c){return c===","||c==="="}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function skipWhitespace(parserState){while(parserState.pos0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.normalizedPathLast;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else if(parserState.userQuery[parserState.pos]==="&"){if(parserState.typeFilter!==null&&parserState.typeFilter!=="primitive"){throw["Invalid search type: primitive ","&"," and ",parserState.typeFilter," both specified",]}parserState.typeFilter=null;parserState.pos+=1;let c=parserState.userQuery[parserState.pos];while(c===" "&&parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();const match=query.match(REGEX_INVALID_TYPE_FILTER);if(match){throw["Unexpected ",match[0]," in type filter (before ",":",")",]}}function createQueryElement(query,parserState,name,generics,isInGenerics){const path=name.trim();if(path.length===0&&generics.length===0){throw["Unexpected ",parserState.userQuery[parserState.pos]]}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name.trim()==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/).map(x=>x.toLowerCase());if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name.toLowerCase().replace(/_/g,""),gen.bindingName.generics,);return false}return true}),bindings,typeFilter,bindingName,}}function makePrimitiveElement(name,extra){return Object.assign({name:name,id:null,fullPath:[name],pathWithoutLast:[],pathLast:name,normalizedPathLast:name,generics:[],bindings:new Map(),typeFilter:"primitive",bindingName:null,},extra)}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function getIdentEndPosition(parserState){let afterIdent=consumeIdent(parserState);let end=parserState.pos;let macroExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]," (not a valid identifier)"]}else{throw["Unexpected ",c," (not a valid identifier)"]}parserState.pos+=1;afterIdent=consumeIdent(parserState);end=parserState.pos}if(macroExclamation!==-1){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=macroExclamation}return end}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function consumeIdent(parserState){REGEX_IDENT.lastIndex=parserState.pos;const match=parserState.userQuery.match(REGEX_IDENT);if(match){parserState.pos+=match[0].length;return true}return false}function isPathSeparator(c){return c===":"||c===" "}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==125){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){let n=0;let c=this.string.charCodeAt(this.offset);if(c===123){this.offset+=1;return this.decodeList()}while(c<96){n=(n<<4)|(c&0xF);this.offset+=1;c=this.string.charCodeAt(this.offset)}n=(n<<4)|(c&0xF);const[sign,value]=[n&1,n>>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);if(c>=48&&c<64){this.offset+=1;return this.backrefQueue[c-48]}if(c===96){this.offset+=1;return this.cons(0)}const result=this.cons(this.decode());this.backrefQueue.unshift(result);if(this.backrefQueue.length>16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;let left=0;let right=this.keys.length-1;while(left<=right){const mid=Math.floor((left+right)/2);const x=this.keys[mid];if(xkey){right=mid-1}else{return this.containers[mid].contains(value)}}return false}}class RoaringBitmapRun{constructor(runcount,array){this.runcount=runcount;this.array=array}contains(value){let left=0;let right=this.runcount-1;while(left<=right){const mid=Math.floor((left+right)/2);const i=mid*4;const start=this.array[i]|(this.array[i+1]<<8);const lenm1=this.array[i+2]|(this.array[i+3]<<8);if((start+lenm1)value){right=mid-1}else{return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){let left=0;let right=this.cardinality-1;while(left<=right){const mid=Math.floor((left+right)/2);const i=mid*2;const x=this.array[i]|(this.array[i+1]<<8);if(xvalue){right=mid-1}else{return true}}return false}}class RoaringBitmapBits{constructor(array){this.array=array}contains(value){return!!(this.array[value>>3]&(1<<(value&7)))}}class NameTrie{constructor(){this.children=[];this.matches=[]}insert(name,id,tailTable){this.insertSubstring(name,0,id,tailTable)}insertSubstring(name,substart,id,tailTable){const l=name.length;if(substart===l){this.matches.push(id)}else{const sb=name.charCodeAt(substart);let child;if(this.children[sb]!==undefined){child=this.children[sb]}else{child=new NameTrie();this.children[sb]=child;let sste;if(substart>=2){const tail=name.substring(substart-2,substart+1);if(tailTable.has(tail)){sste=tailTable.get(tail)}else{sste=[];tailTable.set(tail,sste)}sste.push(child)}}child.insertSubstring(name,substart+1,id,tailTable)}}search(name,tailTable){const results=new Set();this.searchSubstringPrefix(name,0,results);if(results.size=3){const levParams=name.length>=6?new Lev2TParametricDescription(name.length):new Lev1TParametricDescription(name.length);this.searchLev(name,0,levParams,results);const tail=name.substring(0,3);if(tailTable.has(tail)){for(const entry of tailTable.get(tail)){entry.searchSubstringPrefix(name,3,results)}}}return[...results]}searchSubstringPrefix(name,substart,results){const l=name.length;if(substart===l){for(const match of this.matches){results.add(match)}let unprocessedChildren=[];for(const child of this.children){if(child){unprocessedChildren.push(child)}}let nextSet=[];while(unprocessedChildren.length!==0){const next=unprocessedChildren.pop();for(const child of next.children){if(child){nextSet.push(child)}}for(const match of next.matches){results.add(match)}if(unprocessedChildren.length===0){const tmp=unprocessedChildren;unprocessedChildren=nextSet;nextSet=tmp}}}else{const sb=name.charCodeAt(substart);if(this.children[sb]!==undefined){this.children[sb].searchSubstringPrefix(name,substart+1,results)}}}searchLev(name,substart,levParams,results){const stack=[[this,0]];const n=levParams.n;while(stack.length!==0){const[trie,levState]=stack.pop();for(const[charCode,child]of trie.children.entries()){if(!child){continue}const levPos=levParams.getPosition(levState);const vector=levParams.getVector(name,charCode,levPos,Math.min(name.length,levPos+(2*n)+1),);const newLevState=levParams.transition(levState,levPos,vector,);if(newLevState>=0){stack.push([child,newLevState]);if(levParams.isAccept(newLevState)){for(const match of child.matches){results.add(match)}}}}}}}class DocSearch{constructor(rawSearchIndex,rootPath,searchState){this.searchIndexDeprecated=new Map();this.searchIndexEmptyDesc=new Map();this.functionTypeFingerprint=new Uint32Array(0);this.typeNameIdMap=new Map();this.assocTypeIdNameMap=new Map();this.ALIASES=new Map();this.rootPath=rootPath;this.searchState=searchState;this.typeNameIdOfArray=this.buildTypeMapIndex("array");this.typeNameIdOfSlice=this.buildTypeMapIndex("slice");this.typeNameIdOfArrayOrSlice=this.buildTypeMapIndex("[]");this.typeNameIdOfTuple=this.buildTypeMapIndex("tuple");this.typeNameIdOfUnit=this.buildTypeMapIndex("unit");this.typeNameIdOfTupleOrUnit=this.buildTypeMapIndex("()");this.typeNameIdOfFn=this.buildTypeMapIndex("fn");this.typeNameIdOfFnMut=this.buildTypeMapIndex("fnmut");this.typeNameIdOfFnOnce=this.buildTypeMapIndex("fnonce");this.typeNameIdOfHof=this.buildTypeMapIndex("->");this.typeNameIdOfOutput=this.buildTypeMapIndex("output",true);this.typeNameIdOfReference=this.buildTypeMapIndex("reference");this.EMPTY_BINDINGS_MAP=new Map();this.EMPTY_GENERICS_ARRAY=[];this.TYPES_POOL=new Map();this.nameTrie=new NameTrie();this.tailTable=new Map();this.searchIndex=this.buildIndex(rawSearchIndex)}buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(this.typeNameIdMap.has(name)){const obj=this.typeNameIdMap.get(name);obj.assocOnly=!!(isAssocType&&obj.assocOnly);return obj.id}else{const id=this.typeNameIdMap.size;this.typeNameIdMap.set(name,{id,assocOnly:!!isAssocType});return id}}buildItemSearchTypeAll(types,paths,lowercasePaths){return types&&types.length>0?types.map(type=>this.buildItemSearchType(type,paths,lowercasePaths)):this.EMPTY_GENERICS_ARRAY}buildItemSearchType(type,paths,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=this.EMPTY_GENERICS_ARRAY;bindings=this.EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=this.buildItemSearchTypeAll(type[GENERICS_DATA],paths,lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[this.buildItemSearchType(assocType,paths,lowercasePaths,true).id,this.buildItemSearchTypeAll(constraints,paths,lowercasePaths),]}))}else{bindings=this.EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,name:"",ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,unboxFlag:true,}}else if(pathIndex===0){result={id:null,name:"",ty:null,path:null,exactPath:null,generics,bindings,unboxFlag:true,}}else{const item=lowercasePaths[pathIndex-1];const id=this.buildTypeMapIndex(item.name,isAssocType);if(isAssocType&&id!==null){this.assocTypeIdNameMap.set(id,paths[pathIndex-1].name)}result={id,name:paths[pathIndex-1].name,ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,unboxFlag:item.unboxFlag,}}const cr=this.TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty&&cr.name===result.name&&cr.unboxFlag===result.unboxFlag){return cr}}this.TYPES_POOL.set(result.id,result);return result}buildFunctionTypeFingerprint(type,output){let input=type.id;if(input===this.typeNameIdOfArray||input===this.typeNameIdOfSlice){input=this.typeNameIdOfArrayOrSlice}if(input===this.typeNameIdOfTuple||input===this.typeNameIdOfUnit){input=this.typeNameIdOfTupleOrUnit}if(input===this.typeNameIdOfFn||input===this.typeNameIdOfFnMut||input===this.typeNameIdOfFnOnce){input=this.typeNameIdOfHof}const hashint1=k=>{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));output[3]+=1}for(const g of type.generics){this.buildFunctionTypeFingerprint(g,output)}const fb={id:null,ty:0,generics:this.EMPTY_GENERICS_ARRAY,bindings:this.EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;this.buildFunctionTypeFingerprint(fb,output)}}buildIndex(rawSearchIndex){const buildFunctionSearchTypeCallback=(paths,lowercasePaths)=>{const cb=functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs;let output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[this.buildItemSearchType(functionSearchType[INPUTS_DATA],paths,lowercasePaths,),]}else{inputs=this.buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],paths,lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[this.buildItemSearchType(functionSearchType[OUTPUT_DATA],paths,lowercasePaths,),]}else{output=this.buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],paths,lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{const n=noop;return n});let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];this.searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));this.searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;let lastParamNames=[];let normalizedName=crate.indexOf("_")===-1?crate:crate.replace(/_/g,"");const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,paramNames:lastParamNames,id,word:crate,normalizedName,bitIndex:0,implDisambiguator:null,};this.nameTrie.insert(normalizedName,id,this.tailTable);id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!this.searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxDecoder=new VlqHexDecoder(crateCorpus.i,noop=>noop);const implDisambiguator=new Map(crateCorpus.b);const rawPaths=crateCorpus.p;const aliases=crateCorpus.a;const itemParamNames=new Map(crateCorpus.P);const lowercasePaths=[];const paths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(paths,lowercasePaths),);let len=rawPaths.length;let lastPath=itemPaths.get(0);for(let i=0;i2&&elem[2]!==null){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}let exactPath=elem.length>3&&elem[3]!==null?itemPaths.get(elem[3]):path;const unboxFlag=elem.length>4&&!!elem[4];if(path===undefined){path=null}if(exactPath===undefined){exactPath=null}lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath,unboxFlag});paths[i]={ty,name,path,exactPath,unboxFlag}}lastPath="";len=itemTypes.length;let lastName="";let lastWord="";for(let i=0;i=descShard.len&&!this.searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}const name=itemNames[i]===""?lastName:itemNames[i];const word=itemNames[i]===""?lastWord:itemNames[i].toLowerCase();const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const paramNames=itemParamNames.has(i)?itemParamNames.get(i).split(","):lastParamNames;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=this.functionTypeFingerprint.subarray(id*4,(id+1)*4);for(const t of type.inputs){this.buildFunctionTypeFingerprint(t,fp)}for(const t of type.output){this.buildFunctionTypeFingerprint(t,fp)}for(const w of type.where_clause){for(const t of w){this.buildFunctionTypeFingerprint(t,fp)}}}}const itemParentIdx=itemParentIdxDecoder.next();normalizedName=word.indexOf("_")===-1?word:word.replace(/_/g,"");const row={crate,ty:itemTypes.charCodeAt(i)-65,name,path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdx>0?paths[itemParentIdx-1]:undefined,type,paramNames,id,word,normalizedName,bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};this.nameTrie.insert(normalizedName,id,this.tailTable);id+=1;searchIndex.push(row);lastPath=row.path;lastParamNames=row.paramNames;if(!this.searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}lastName=name;lastWord=word}if(aliases){const currentCrateAliases=new Map();this.ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;this.searchState.descShards.set(crate,descShardList)}this.TYPES_POOL=new Map();return searchIndex}static parseQuery(userQuery){function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}function newParsedQuery(userQuery){return{userQuery,elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,hasReturnArrow:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){query.hasReturnArrow=true;break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}async execQuery(origParsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();const parsedQuery=origParsedQuery;const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();const convertNameToId=(elem,isAssocType)=>{const loweredName=elem.pathLast.toLowerCase();if(this.typeNameIdMap.has(loweredName)&&(isAssocType||!this.typeNameIdMap.get(loweredName).assocOnly)){elem.id=this.typeNameIdMap.get(loweredName).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of this.typeNameIdMap){const dist=Math.min(editDistance(name,loweredName,maxEditDistance),editDistance(name,elem.normalizedPathLast,maxEditDistance),);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.normalizedPathLast)){elem.id=genericSymbols.get(elem.normalizedPathLast)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.normalizedPathLast,elem.id)}if(elem.typeFilter===-1&&elem.normalizedPathLast.length>=3){const maxPartDistance=Math.floor(elem.normalizedPathLast.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of this.typeNameIdMap.keys()){const dist=editDistance(name,elem.normalizedPathLast,maxPartDistance,);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!this.typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[0,[]]}for(const elem2 of constraints){convertNameToId(elem2,false)}return[this.typeNameIdMap.get(name).id,constraints]}),)};for(const elem of parsedQuery.elems){convertNameToId(elem,false);this.buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint)}for(const elem of parsedQuery.returned){convertNameToId(elem,false);this.buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint)}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}const buildHrefAndPath=item=>{let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=this.rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=this.rootPath+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";exactPath="";href=this.rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=this.rootPath+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::";exactPath=myparent.name}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=this.rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=this.rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]};function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}const transformResults=(results,typeInfo)=>{const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const res=buildHrefAndPath(this.searchIndex[result.id]);const obj=Object.assign({dist:result.dist,displayPath:pathSplitter(res[0]),},this.searchIndex[result.id]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);if(typeInfo!==null){obj.displayTypeSignature=this.formatDisplayTypeSignature(obj,typeInfo)}obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out};this.formatDisplayTypeSignature=async(obj,typeInfo)=>{const objType=obj.type;if(!objType){return{type:[],mappedNames:new Map(),whereClause:new Map()}}let fnInputs=null;let fnOutput=null;let mgens=null;if(typeInfo!=="elems"&&typeInfo!=="returned"){fnInputs=unifyFunctionTypes(objType.inputs,parsedQuery.elems,objType.where_clause,null,mgensScratch=>{fnOutput=unifyFunctionTypes(objType.output,parsedQuery.returned,objType.where_clause,mgensScratch,mgensOut=>{mgens=mgensOut;return true},0,);return!!fnOutput},0,)}else{const arr=typeInfo==="elems"?objType.inputs:objType.output;const highlighted=unifyFunctionTypes(arr,parsedQuery.elems,objType.where_clause,null,mgensOut=>{mgens=mgensOut;return true},0,);if(typeInfo==="elems"){fnInputs=highlighted}else{fnOutput=highlighted}}if(!fnInputs){fnInputs=objType.inputs}if(!fnOutput){fnOutput=objType.output}const mappedNames=new Map();const whereClause=new Map();const fnParamNames=obj.paramNames||[];const queryParamNames=[];const remapQuery=queryElem=>{if(queryElem.id!==null&&queryElem.id<0){queryParamNames[-1-queryElem.id]=queryElem.name}if(queryElem.generics.length>0){queryElem.generics.forEach(remapQuery)}if(queryElem.bindings.size>0){[...queryElem.bindings.values()].flat().forEach(remapQuery)}};parsedQuery.elems.forEach(remapQuery);parsedQuery.returned.forEach(remapQuery);const pushText=(fnType,result)=>{if(!!(result.length%2)===!!fnType.highlighted){result.push("")}else if(result.length===0&&!!fnType.highlighted){result.push("");result.push("")}result[result.length-1]+=fnType.name};const writeHof=(fnType,result)=>{const hofOutput=fnType.bindings.get(this.typeNameIdOfOutput)||[];const hofInputs=fnType.generics;pushText(fnType,result);pushText({name:" (",highlighted:false},result);let needsComma=false;for(const fnType of hofInputs){if(needsComma){pushText({name:", ",highlighted:false},result)}needsComma=true;writeFn(fnType,result)}pushText({name:hofOutput.length===0?")":") -> ",highlighted:false,},result);if(hofOutput.length>1){pushText({name:"(",highlighted:false},result)}needsComma=false;for(const fnType of hofOutput){if(needsComma){pushText({name:", ",highlighted:false},result)}needsComma=true;writeFn(fnType,result)}if(hofOutput.length>1){pushText({name:")",highlighted:false},result)}};const writeSpecialPrimitive=(fnType,result)=>{if(fnType.id===this.typeNameIdOfArray||fnType.id===this.typeNameIdOfSlice||fnType.id===this.typeNameIdOfTuple||fnType.id===this.typeNameIdOfUnit){const[ob,sb]=fnType.id===this.typeNameIdOfArray||fnType.id===this.typeNameIdOfSlice?["[","]"]:["(",")"];pushText({name:ob,highlighted:fnType.highlighted},result);onEachBtwn(fnType.generics,nested=>writeFn(nested,result),()=>pushText({name:", ",highlighted:false},result),);pushText({name:sb,highlighted:fnType.highlighted},result);return true}else if(fnType.id===this.typeNameIdOfReference){pushText({name:"&",highlighted:fnType.highlighted},result);let prevHighlighted=false;onEachBtwn(fnType.generics,value=>{prevHighlighted=!!value.highlighted;writeFn(value,result)},value=>pushText({name:" ",highlighted:prevHighlighted&&value.highlighted,},result),);return true}else if(fnType.id===this.typeNameIdOfFn){writeHof(fnType,result);return true}return false};const writeFn=(fnType,result)=>{if(fnType.id!==null&&fnType.id<0){if(fnParamNames[-1-fnType.id]===""){const generics=fnType.generics.length>0?fnType.generics:objType.where_clause[-1-fnType.id];for(const nested of generics){writeFn(nested,result)}return}else if(mgens){for(const[queryId,fnId]of mgens){if(fnId===fnType.id){mappedNames.set(queryParamNames[-1-queryId],fnParamNames[-1-fnType.id],)}}}pushText({name:fnParamNames[-1-fnType.id],highlighted:!!fnType.highlighted,},result);const where=[];onEachBtwn(fnType.generics,nested=>writeFn(nested,where),()=>pushText({name:" + ",highlighted:false},where),);if(where.length>0){whereClause.set(fnParamNames[-1-fnType.id],where)}}else{if(fnType.ty===TY_PRIMITIVE){if(writeSpecialPrimitive(fnType,result)){return}}else if(fnType.ty===TY_TRAIT&&(fnType.id===this.typeNameIdOfFn||fnType.id===this.typeNameIdOfFnMut||fnType.id===this.typeNameIdOfFnOnce)){writeHof(fnType,result);return}pushText(fnType,result);let hasBindings=false;if(fnType.bindings.size>0){onEachBtwn(fnType.bindings,([key,values])=>{const name=this.assocTypeIdNameMap.get(key);if(values.length===1&&values[0].id<0&&`${fnType.name}::${name}`===fnParamNames[-1-values[0].id]){for(const value of values){writeFn(value,[])}return true}if(!hasBindings){hasBindings=true;pushText({name:"<",highlighted:false},result)}pushText({name,highlighted:false},result);pushText({name:values.length!==1?"=(":"=",highlighted:false,},result);onEachBtwn(values||[],value=>writeFn(value,result),()=>pushText({name:" + ",highlighted:false},result),);if(values.length!==1){pushText({name:")",highlighted:false},result)}},()=>pushText({name:", ",highlighted:false},result),)}if(fnType.generics.length>0){pushText({name:hasBindings?", ":"<",highlighted:false},result)}onEachBtwn(fnType.generics,value=>writeFn(value,result),()=>pushText({name:", ",highlighted:false},result),);if(hasBindings||fnType.generics.length>0){pushText({name:">",highlighted:false},result)}}};const type=[];onEachBtwn(fnInputs,fnType=>writeFn(fnType,type),()=>pushText({name:", ",highlighted:false},type),);pushText({name:" -> ",highlighted:false},type);onEachBtwn(fnOutput,fnType=>writeFn(fnType,type),()=>pushText({name:", ",highlighted:false},type),);return{type,mappedNames,whereClause}};const sortResults=async(results,typeInfo,preferredCrate)=>{const userQuery=parsedQuery.userQuery;const normalizedUserQuery=parsedQuery.userQuery.toLowerCase();const isMixedCase=normalizedUserQuery!==userQuery;const result_list=[];const isReturnTypeQuery=parsedQuery.elems.length===0||typeInfo==="returned";for(const result of results.values()){result.item=this.searchIndex[result.id];result.word=this.searchIndex[result.id].word;if(isReturnTypeQuery){const resultItemType=result.item&&result.item.type;if(!resultItemType){continue}const inputs=resultItemType.inputs;const where_clause=resultItemType.where_clause;if(containsTypeFromQuery(inputs,where_clause)){result.path_dist*=100;result.dist*=100}}result_list.push(result)}result_list.sort((aaa,bbb)=>{let a;let b;if(isMixedCase){a=Number(aaa.item.name!==userQuery);b=Number(bbb.item.name!==userQuery);if(a!==b){return a-b}}a=Number(aaa.word!==normalizedUserQuery);b=Number(bbb.word!==normalizedUserQuery);if(a!==b){return a-b}a=Number(aaa.index<0);b=Number(bbb.index<0);if(a!==b){return a-b}if(parsedQuery.hasReturnArrow){a=Number(!isFnLikeTy(aaa.item.ty));b=Number(!isFnLikeTy(bbb.item.ty));if(a!==b){return a-b}}a=Number(aaa.path_dist);b=Number(bbb.path_dist);if(a!==b){return a-b}a=Number(aaa.index);b=Number(bbb.index);if(a!==b){return a-b}a=Number(aaa.dist);b=Number(bbb.dist);if(a!==b){return a-b}a=Number(this.searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex),);b=Number(this.searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex),);if(a!==b){return a-b}a=Number(aaa.item.crate!==preferredCrate);b=Number(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=Number(aaa.word.length);b=Number(bbb.word.length);if(a!==b){return a-b}let aw=aaa.word;let bw=bbb.word;if(aw!==bw){return(aw>bw?+1:-1)}a=Number(this.searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex),);b=Number(this.searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex),);if(a!==b){return a-b}a=Number(aaa.item.ty);b=Number(bbb.item.ty);if(a!==b){return a-b}aw=aaa.item.path;bw=bbb.item.path;if(aw!==bw){return(aw>bw?+1:-1)}return 0});return transformResults(result_list,typeInfo)};function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return null}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return solutionCb(mgens)?fnTypesIn:null}if(!fnTypesIn||fnTypesIn.length===0){return null}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const[i,fnType]of fnTypesIn.entries()){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id!==null&&fnType.id<0&&queryElem.id!==null&&queryElem.id<0){if(mgens&&mgens.has(queryElem.id)&&mgens.get(queryElem.id)!==fnType.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(queryElem.id,fnType.id);if(!solutionCb||solutionCb(mgensScratch)){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:whereClause[-1-fnType.id],});return highlighted}}else if(solutionCb(mgens?new Map(mgens):null)){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:unifyGenericTypes(fnType.generics,queryElem.generics,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth,)||fnType.generics,});return highlighted}}for(const[i,fnType]of fnTypesIn.entries()){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){const highlightedGenerics=unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgens,solutionCb,unboxingDepth+1,);if(highlightedGenerics){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:highlightedGenerics,});return highlighted}}else{const highlightedGenerics=unifyFunctionTypes([...Array.from(fnType.bindings.values()).flat(),...fnType.generics],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,);if(highlightedGenerics){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),});return highlighted}}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id!==null&&queryElem.id!==null&&fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(queryElem.id)&&mgensScratch.get(queryElem.id)!==fnType.id){continue}mgensScratch.set(queryElem.id,fnType.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}let unifiedGenerics=[];let unifiedGenericsMgens=null;const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){unifiedGenerics=unifyGenericTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(unifiedGenerics!==null){unifiedGenericsMgens=simplifiedMgens;return true}}return false},unboxingDepth,);if(passesUnification){passesUnification.length=fl;passesUnification[flast]=passesUnification[i];passesUnification[i]=Object.assign({},fnType,{highlighted:true,generics:unifiedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,queryElem.bindings.has(k)?unifyFunctionTypes(v,queryElem.bindings.get(k),whereClause,unifiedGenericsMgens,solutionCb,unboxingDepth,):unifiedGenerics.splice(0,v.length)]})),});return passesUnification}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}const generics=fnType.id!==null&&fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...bindings,...generics),queryElems,whereClause,mgens,solutionCb,unboxingDepth+1,);if(passesUnification){const highlightedGenerics=passesUnification.slice(i,i+generics.length+bindings.length,);const highlightedFnType=Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),});return passesUnification.toSpliced(i,generics.length+bindings.length,highlightedFnType,)}}return null}function unifyGenericTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return null}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return solutionCb(mgens)?fnTypesIn:null}if(!fnTypesIn||fnTypesIn.length===0){return null}const fnType=fnTypesIn[0];const queryElem=queryElems[0];if(unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){if(fnType.id!==null&&fnType.id<0&&queryElem.id!==null&&queryElem.id<0){if(!mgens||!mgens.has(queryElem.id)||mgens.get(queryElem.id)===fnType.id){const mgensScratch=new Map(mgens);mgensScratch.set(queryElem.id,fnType.id);const fnTypesRemaining=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(fnTypesRemaining){const highlighted=[fnType,...fnTypesRemaining];highlighted[0]=Object.assign({highlighted:true,},fnType,{generics:whereClause[-1-fnType.id],});return highlighted}}}else{let unifiedGenerics;const fnTypesRemaining=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgens,mgensScratch=>{const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){unifiedGenerics=unifyGenericTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(unifiedGenerics!==null){return true}}},unboxingDepth,);if(fnTypesRemaining){const highlighted=[fnType,...fnTypesRemaining];highlighted[0]=Object.assign({highlighted:true,},fnType,{generics:unifiedGenerics||fnType.generics,});return highlighted}}}if(unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){let highlightedRemaining;if(fnType.id!==null&&fnType.id<0){const highlightedGenerics=unifyFunctionTypes(whereClause[(-fnType.id)-1],[queryElem],whereClause,mgens,mgensScratch=>{const hl=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(hl){highlightedRemaining=hl}return hl},unboxingDepth+1,);if(highlightedGenerics){return[Object.assign({highlighted:true,},fnType,{generics:highlightedGenerics,}),...highlightedRemaining]}}else{const highlightedGenerics=unifyGenericTypes([...Array.from(fnType.bindings.values()).flat(),...fnType.generics,],[queryElem],whereClause,mgens,mgensScratch=>{const hl=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(hl){highlightedRemaining=hl}return hl},unboxingDepth+1,);if(highlightedGenerics){return[Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),}),...highlightedRemaining]}}}return null}const unifyFunctionTypeIsMatchCandidate=(fnType,queryElem,mgensIn)=>{if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id!==null&&fnType.id<0&&queryElem.id!==null&&queryElem.id<0){if(mgensIn&&mgensIn.has(queryElem.id)&&mgensIn.get(queryElem.id)!==fnType.id){return false}return true}else{if(queryElem.id===this.typeNameIdOfArrayOrSlice&&(fnType.id===this.typeNameIdOfSlice||fnType.id===this.typeNameIdOfArray)){}else if(queryElem.id===this.typeNameIdOfTupleOrUnit&&(fnType.id===this.typeNameIdOfTuple||fnType.id===this.typeNameIdOfUnit)){}else if(queryElem.id===this.typeNameIdOfHof&&(fnType.id===this.typeNameIdOfFn||fnType.id===this.typeNameIdOfFnMut||fnType.id===this.typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...binds,...simplifiedGenerics]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id!==null&&fnType.id<0){if(!whereClause){return false}return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgens,unboxingDepth,)}else if(fnType.unboxFlag&&(fnType.generics.length>0||fnType.bindings.size>0)){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function containsTypeFromQuery(list,where_clause){if(!list)return false;for(const ty of parsedQuery.returned){if(ty.id!==null&&ty.id<0){continue}if(checkIfInList(list,ty,where_clause,null,0)){return true}}for(const ty of parsedQuery.elems){if(ty.id!==null&&ty.id<0){continue}if(checkIfInList(list,ty,where_clause,null,0)){return true}}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}const checkType=(row,elem,whereClause,mgens,unboxingDepth)=>{if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.id!==null&&elem.id!==null&&row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&row.generics.length===0&&elem.generics.length===0&&row.bindings.size===0&&elem.bindings.size===0&&elem.id!==this.typeNameIdOfArrayOrSlice&&elem.id!==this.typeNameIdOfHof&&elem.id!==this.typeNameIdOfTupleOrUnit){return row.id===elem.id&&typePassesFilter(elem.typeFilter,row.ty)}else{return unifyFunctionTypes([row],[elem],whereClause,mgens,()=>true,unboxingDepth,)}};const checkTypeMgensForConflict=mgens=>{if(!mgens){return true}const fnTypes=new Set();for(const[_qid,fid]of mgens){if(fnTypes.has(fid)){return false}fnTypes.add(fid)}return true};function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}const handleAliases=async(ret,query,filterCrates,currentCrate)=>{const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(this.ALIASES.has(filterCrates)&&this.ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=this.ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(this.searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of this.ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(this.searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{return this.searchIndexEmptyDesc.get(alias.crate).contains(alias.bitIndex)?"":this.searchState.loadDesc(alias)};const[crateDescs,descs]=await Promise.all([Promise.all(crateAliases.map(fetchDesc)),Promise.all(aliases.map(fetchDesc)),]);const pushFunc=alias=>{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach((alias,i)=>{alias.desc=descs[i]});aliases.forEach(pushFunc);crateAliases.forEach((alias,i)=>{alias.desc=crateDescs[i]});crateAliases.forEach(pushFunc)};function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}const rowType=row.type;if(!rowType){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(rowType.inputs,parsedQuery.elems,rowType.where_clause,null,mgens=>{return unifyFunctionTypes(rowType.output,parsedQuery.returned,rowType.where_clause,mgens,checkTypeMgensForConflict,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id.toString(),pos,0,tfpDist,0,Number.MAX_VALUE)}const compareTypeFingerprints=(fullId,queryFingerprint)=>{const fh0=this.functionTypeFingerprint[fullId*4];const fh1=this.functionTypeFingerprint[(fullId*4)+1];const fh2=this.functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return this.functionTypeFingerprint[(fullId*4)+3]};const innerRunQuery=()=>{if(parsedQuery.foundElems===1&&!parsedQuery.hasReturnArrow){const elem=parsedQuery.elems[0];const handleNameSearch=id=>{const row=this.searchIndex[id];if(!typePassesFilter(elem.typeFilter,row.ty)||(filterCrates!==null&&row.crate!==filterCrates)){return}let pathDist=0;if(elem.fullPath.length>1){pathDist=checkPath(elem.pathWithoutLast,row);if(pathDist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,row.id,id,0,0,pathDist)}}else{addIntoResults(results_others,row.id,id,row.normalizedName.indexOf(elem.normalizedPathLast),editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance,),pathDist,maxEditDistance,)}};if(elem.normalizedPathLast!==""){const last=elem.normalizedPathLast;for(const id of this.nameTrie.search(last,this.tailTable)){handleNameSearch(id)}}const length=this.searchIndex.length;for(let i=0,nSearchIndex=length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=this.searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return this.searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":this.searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}}let rawSearchIndex;let docSearch;const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];let currentResults;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&window.searchIndex.has(elem.value)){return elem.value}return null}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement(array.length===0&&query.error===null?"div":"ul",);if(array.length>0){output.className="search-results "+extraClass;const lis=Promise.all(array.map(async item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("span");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);if(item.displayTypeSignature){const{type,mappedNames,whereClause}=await item.displayTypeSignature;const displayType=document.createElement("div");type.forEach((value,index)=>{if(index%2!==0){const highlight=document.createElement("strong");highlight.appendChild(document.createTextNode(value));displayType.appendChild(highlight)}else{displayType.appendChild(document.createTextNode(value))}});if(mappedNames.size>0||whereClause.size>0){let addWhereLineFn=()=>{const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode("where"));displayType.appendChild(line);addWhereLineFn=()=>{}};for(const[qname,name]of mappedNames){if(name===qname){continue}addWhereLineFn();const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode(` ${qname} matches `));const lineStrong=document.createElement("strong");lineStrong.appendChild(document.createTextNode(name));line.appendChild(lineStrong);displayType.appendChild(line)}for(const[name,innerType]of whereClause){if(innerType.length<=1){continue}addWhereLineFn();const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode(` ${name}: `));innerType.forEach((value,index)=>{if(index%2!==0){const highlight=document.createElement("strong");highlight.appendChild(document.createTextNode(value));line.appendChild(highlight)}else{line.appendChild(document.createTextNode(value))}});displayType.appendChild(line)}}displayType.className="type-signature";link.appendChild(displayType)}link.appendChild(description);return link}));lis.then(lis=>{for(const li of lis){output.appendChild(li)}})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return output}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=DocSearch.parseQuery(searchState.input.value)}currentResults=results.query.userQuery;let currentTab=searchState.currentTab;if((currentTab===0&&results.others.length===0)||(currentTab===1&&results.in_args.length===0)||(currentTab===2&&results.returned.length===0)){if(results.others.length!==0){currentTab=0}else if(results.in_args.length){currentTab=1}else if(results.returned.length){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates="
in 
"+"
"}let output=`
\ +

Results

${crates}
`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",results.others.length)+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",results.others.length)+makeTabHeader(1,"In Parameters",results.in_args.length)+makeTabHeader(2,"In Return Types",results.returned.length)+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,results.others.length)+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,currentTab===0),addTab(results.in_args,results.query,currentTab===1),addTab(results.returned,results.query,currentTab===2),]);const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others);resultsElem.appendChild(ret_in_args);resultsElem.appendChild(ret_returned);search.innerHTML=output;if(searchState.rustdocToolbar){search.querySelector(".main-heading").appendChild(searchState.rustdocToolbar)}const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=DocSearch.parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="\""+query.userQuery+"\" Search - Rust";updateSearchHistory(buildUrl(query.userQuery,filterCrates));await showResults(await docSearch.execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}function initSearch(searchIndx){rawSearchIndex=searchIndx;if(typeof window!=="undefined"){docSearch=new DocSearch(rawSearchIndex,ROOT_PATH,searchState);registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}else if(typeof exports!=="undefined"){docSearch=new DocSearch(rawSearchIndex,ROOT_PATH,searchState);exports.docSearch=docSearch;exports.parseQuery=DocSearch.parseQuery}}if(typeof exports!=="undefined"){exports.initSearch=initSearch}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}class ParametricDescription{constructor(w,n,minErrors){this.w=w;this.n=n;this.minErrors=minErrors}isAccept(absState){const state=Math.floor(absState/(this.w+1));const offset=absState%(this.w+1);return this.w-offset+this.minErrors[state]<=this.n}getPosition(absState){return absState%(this.w+1)}getVector(name,charCode,pos,end){let vector=0;for(let i=pos;i>5;const bitStart=bitLoc&31;if(bitStart+bitsPerValue<=32){return((data[dataLoc]>>bitStart)&this.MASKS[bitsPerValue-1])}else{const part=32-bitStart;return ~~(((data[dataLoc]>>bitStart)&this.MASKS[part-1])+((data[1+dataLoc]&this.MASKS[bitsPerValue-part-1])<limit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function isFnLikeTy(ty){return ty===TY_FN||ty===TY_METHOD||ty===TY_TYMETHOD}function isSeparatorCharacter(c){return c===","||c==="="}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function skipWhitespace(parserState){while(parserState.pos0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.normalizedPathLast;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else if(parserState.userQuery[parserState.pos]==="&"){if(parserState.typeFilter!==null&&parserState.typeFilter!=="primitive"){throw["Invalid search type: primitive ","&"," and ",parserState.typeFilter," both specified",]}parserState.typeFilter=null;parserState.pos+=1;let c=parserState.userQuery[parserState.pos];while(c===" "&&parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();const match=query.match(REGEX_INVALID_TYPE_FILTER);if(match){throw["Unexpected ",match[0]," in type filter (before ",":",")",]}}function createQueryElement(query,parserState,name,generics,isInGenerics){const path=name.trim();if(path.length===0&&generics.length===0){throw["Unexpected ",parserState.userQuery[parserState.pos]]}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name.trim()==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/).map(x=>x.toLowerCase());if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name.toLowerCase().replace(/_/g,""),gen.bindingName.generics,);return false}return true}),bindings,typeFilter,bindingName,}}function makePrimitiveElement(name,extra){return Object.assign({name,id:null,fullPath:[name],pathWithoutLast:[],pathLast:name,normalizedPathLast:name,generics:[],bindings:new Map(),typeFilter:"primitive",bindingName:null,},extra)}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function getIdentEndPosition(parserState){let afterIdent=consumeIdent(parserState);let end=parserState.pos;let macroExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]," (not a valid identifier)"]}else{throw["Unexpected ",c," (not a valid identifier)"]}parserState.pos+=1;afterIdent=consumeIdent(parserState);end=parserState.pos}if(macroExclamation!==-1){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=macroExclamation}return end}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function consumeIdent(parserState){REGEX_IDENT.lastIndex=parserState.pos;const match=parserState.userQuery.match(REGEX_IDENT);if(match){parserState.pos+=match[0].length;return true}return false}function isPathSeparator(c){return c===":"||c===" "}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==125){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){let n=0;let c=this.string.charCodeAt(this.offset);if(c===123){this.offset+=1;return this.decodeList()}while(c<96){n=(n<<4)|(c&0xF);this.offset+=1;c=this.string.charCodeAt(this.offset)}n=(n<<4)|(c&0xF);const[sign,value]=[n&1,n>>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);if(c>=48&&c<64){this.offset+=1;return this.backrefQueue[c-48]}if(c===96){this.offset+=1;return this.cons(0)}const result=this.cons(this.decode());this.backrefQueue.unshift(result);if(this.backrefQueue.length>16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;let left=0;let right=this.keys.length-1;while(left<=right){const mid=Math.floor((left+right)/2);const x=this.keys[mid];if(xkey){right=mid-1}else{return this.containers[mid].contains(value)}}return false}}class RoaringBitmapRun{constructor(runcount,array){this.runcount=runcount;this.array=array}contains(value){let left=0;let right=this.runcount-1;while(left<=right){const mid=Math.floor((left+right)/2);const i=mid*4;const start=this.array[i]|(this.array[i+1]<<8);const lenm1=this.array[i+2]|(this.array[i+3]<<8);if((start+lenm1)value){right=mid-1}else{return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){let left=0;let right=this.cardinality-1;while(left<=right){const mid=Math.floor((left+right)/2);const i=mid*2;const x=this.array[i]|(this.array[i+1]<<8);if(xvalue){right=mid-1}else{return true}}return false}}class RoaringBitmapBits{constructor(array){this.array=array}contains(value){return!!(this.array[value>>3]&(1<<(value&7)))}}class NameTrie{constructor(){this.children=[];this.matches=[]}insert(name,id,tailTable){this.insertSubstring(name,0,id,tailTable)}insertSubstring(name,substart,id,tailTable){const l=name.length;if(substart===l){this.matches.push(id)}else{const sb=name.charCodeAt(substart);let child;if(this.children[sb]!==undefined){child=this.children[sb]}else{child=new NameTrie();this.children[sb]=child;let sste;if(substart>=2){const tail=name.substring(substart-2,substart+1);if(tailTable.has(tail)){sste=tailTable.get(tail)}else{sste=[];tailTable.set(tail,sste)}sste.push(child)}}child.insertSubstring(name,substart+1,id,tailTable)}}search(name,tailTable){const results=new Set();this.searchSubstringPrefix(name,0,results);if(results.size=3){const levParams=name.length>=6?new Lev2TParametricDescription(name.length):new Lev1TParametricDescription(name.length);this.searchLev(name,0,levParams,results);const tail=name.substring(0,3);if(tailTable.has(tail)){for(const entry of tailTable.get(tail)){entry.searchSubstringPrefix(name,3,results)}}}return[...results]}searchSubstringPrefix(name,substart,results){const l=name.length;if(substart===l){for(const match of this.matches){results.add(match)}let unprocessedChildren=[];for(const child of this.children){if(child){unprocessedChildren.push(child)}}let nextSet=[];while(unprocessedChildren.length!==0){const next=unprocessedChildren.pop();for(const child of next.children){if(child){nextSet.push(child)}}for(const match of next.matches){results.add(match)}if(unprocessedChildren.length===0){const tmp=unprocessedChildren;unprocessedChildren=nextSet;nextSet=tmp}}}else{const sb=name.charCodeAt(substart);if(this.children[sb]!==undefined){this.children[sb].searchSubstringPrefix(name,substart+1,results)}}}searchLev(name,substart,levParams,results){const stack=[[this,0]];const n=levParams.n;while(stack.length!==0){const[trie,levState]=stack.pop();for(const[charCode,child]of trie.children.entries()){if(!child){continue}const levPos=levParams.getPosition(levState);const vector=levParams.getVector(name,charCode,levPos,Math.min(name.length,levPos+(2*n)+1),);const newLevState=levParams.transition(levState,levPos,vector,);if(newLevState>=0){stack.push([child,newLevState]);if(levParams.isAccept(newLevState)){for(const match of child.matches){results.add(match)}}}}}}}class DocSearch{constructor(rawSearchIndex,rootPath,searchState){this.searchIndexDeprecated=new Map();this.searchIndexEmptyDesc=new Map();this.functionTypeFingerprint=null;this.typeNameIdMap=new Map();this.assocTypeIdNameMap=new Map();this.ALIASES=new Map();this.rootPath=rootPath;this.searchState=searchState;this.typeNameIdOfArray=this.buildTypeMapIndex("array");this.typeNameIdOfSlice=this.buildTypeMapIndex("slice");this.typeNameIdOfArrayOrSlice=this.buildTypeMapIndex("[]");this.typeNameIdOfTuple=this.buildTypeMapIndex("tuple");this.typeNameIdOfUnit=this.buildTypeMapIndex("unit");this.typeNameIdOfTupleOrUnit=this.buildTypeMapIndex("()");this.typeNameIdOfFn=this.buildTypeMapIndex("fn");this.typeNameIdOfFnMut=this.buildTypeMapIndex("fnmut");this.typeNameIdOfFnOnce=this.buildTypeMapIndex("fnonce");this.typeNameIdOfHof=this.buildTypeMapIndex("->");this.typeNameIdOfOutput=this.buildTypeMapIndex("output",true);this.typeNameIdOfReference=this.buildTypeMapIndex("reference");this.EMPTY_BINDINGS_MAP=new Map();this.EMPTY_GENERICS_ARRAY=[];this.TYPES_POOL=new Map();this.nameTrie=new NameTrie();this.tailTable=new Map();this.searchIndex=this.buildIndex(rawSearchIndex)}buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(this.typeNameIdMap.has(name)){const obj=this.typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=this.typeNameIdMap.size;this.typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}buildItemSearchTypeAll(types,paths,lowercasePaths){return types.length>0?types.map(type=>this.buildItemSearchType(type,paths,lowercasePaths)):this.EMPTY_GENERICS_ARRAY}buildItemSearchType(type,paths,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=this.EMPTY_GENERICS_ARRAY;bindings=this.EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=this.buildItemSearchTypeAll(type[GENERICS_DATA],paths,lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[this.buildItemSearchType(assocType,paths,lowercasePaths,true).id,this.buildItemSearchTypeAll(constraints,paths,lowercasePaths),]}))}else{bindings=this.EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,name:"",ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,unboxFlag:true,}}else if(pathIndex===0){result={id:null,name:"",ty:null,path:null,exactPath:null,generics,bindings,unboxFlag:true,}}else{const item=lowercasePaths[pathIndex-1];const id=this.buildTypeMapIndex(item.name,isAssocType);if(isAssocType){this.assocTypeIdNameMap.set(id,paths[pathIndex-1].name)}result={id,name:paths[pathIndex-1].name,ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,unboxFlag:item.unboxFlag,}}const cr=this.TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty&&cr.name===result.name&&cr.unboxFlag===result.unboxFlag){return cr}}this.TYPES_POOL.set(result.id,result);return result}buildFunctionTypeFingerprint(type,output){let input=type.id;if(input===this.typeNameIdOfArray||input===this.typeNameIdOfSlice){input=this.typeNameIdOfArrayOrSlice}if(input===this.typeNameIdOfTuple||input===this.typeNameIdOfUnit){input=this.typeNameIdOfTupleOrUnit}if(input===this.typeNameIdOfFn||input===this.typeNameIdOfFnMut||input===this.typeNameIdOfFnOnce){input=this.typeNameIdOfHof}const hashint1=k=>{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));output[3]+=1}for(const g of type.generics){this.buildFunctionTypeFingerprint(g,output)}const fb={id:null,ty:0,generics:this.EMPTY_GENERICS_ARRAY,bindings:this.EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;this.buildFunctionTypeFingerprint(fb,output)}}buildIndex(rawSearchIndex){const buildFunctionSearchTypeCallback=(paths,lowercasePaths)=>{return functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[this.buildItemSearchType(functionSearchType[INPUTS_DATA],paths,lowercasePaths,),]}else{inputs=this.buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],paths,lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[this.buildItemSearchType(functionSearchType[OUTPUT_DATA],paths,lowercasePaths,),]}else{output=this.buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],paths,lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;inoop);let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];this.searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));this.searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;let lastParamNames=[];let normalizedName=crate.indexOf("_")===-1?crate:crate.replace(/_/g,"");const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,paramNames:lastParamNames,id,word:crate,normalizedName,bitIndex:0,implDisambiguator:null,};this.nameTrie.insert(normalizedName,id,this.tailTable);id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!this.searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxDecoder=new VlqHexDecoder(crateCorpus.i,noop=>noop);const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const itemParamNames=new Map(crateCorpus.P);const lowercasePaths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(paths,lowercasePaths),);let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2&&elem[2]!==null){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}const exactPath=elem.length>3&&elem[3]!==null?itemPaths.get(elem[3]):path;const unboxFlag=elem.length>4&&!!elem[4];lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath,unboxFlag});paths[i]={ty,name,path,exactPath,unboxFlag}}lastPath="";len=itemTypes.length;let lastName="";let lastWord="";for(let i=0;i=descShard.len&&!this.searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}const name=itemNames[i]===""?lastName:itemNames[i];const word=itemNames[i]===""?lastWord:itemNames[i].toLowerCase();const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const paramNames=itemParamNames.has(i)?itemParamNames.get(i).split(","):lastParamNames;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=this.functionTypeFingerprint.subarray(id*4,(id+1)*4);for(const t of type.inputs){this.buildFunctionTypeFingerprint(t,fp)}for(const t of type.output){this.buildFunctionTypeFingerprint(t,fp)}for(const w of type.where_clause){for(const t of w){this.buildFunctionTypeFingerprint(t,fp)}}}}const itemParentIdx=itemParentIdxDecoder.next();normalizedName=word.indexOf("_")===-1?word:word.replace(/_/g,"");const row={crate,ty:itemTypes.charCodeAt(i)-65,name,path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdx>0?paths[itemParentIdx-1]:undefined,type,paramNames,id,word,normalizedName,bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};this.nameTrie.insert(normalizedName,id,this.tailTable);id+=1;searchIndex.push(row);lastPath=row.path;lastParamNames=row.paramNames;if(!this.searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}lastName=name;lastWord=word}if(aliases){const currentCrateAliases=new Map();this.ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;this.searchState.descShards.set(crate,descShardList)}this.TYPES_POOL=new Map();return searchIndex}static parseQuery(userQuery){function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}function newParsedQuery(userQuery){return{userQuery,elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,hasReturnArrow:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){query.hasReturnArrow=true;break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}async execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}const buildHrefAndPath=item=>{let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=this.rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=this.rootPath+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";exactPath="";href=this.rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=this.rootPath+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::";exactPath=myparent.name}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=this.rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=this.rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]};function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}const transformResults=(results,typeInfo)=>{const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const res=buildHrefAndPath(this.searchIndex[result.id]);const obj=Object.assign({dist:result.dist,displayPath:pathSplitter(res[0]),},this.searchIndex[result.id]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);if(typeInfo!==null){obj.displayTypeSignature=this.formatDisplayTypeSignature(obj,typeInfo)}obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out};this.formatDisplayTypeSignature=async(obj,typeInfo)=>{let fnInputs=null;let fnOutput=null;let mgens=null;if(typeInfo!=="elems"&&typeInfo!=="returned"){fnInputs=unifyFunctionTypes(obj.type.inputs,parsedQuery.elems,obj.type.where_clause,null,mgensScratch=>{fnOutput=unifyFunctionTypes(obj.type.output,parsedQuery.returned,obj.type.where_clause,mgensScratch,mgensOut=>{mgens=mgensOut;return true},0,);return!!fnOutput},0,)}else{const arr=typeInfo==="elems"?obj.type.inputs:obj.type.output;const highlighted=unifyFunctionTypes(arr,parsedQuery.elems,obj.type.where_clause,null,mgensOut=>{mgens=mgensOut;return true},0,);if(typeInfo==="elems"){fnInputs=highlighted}else{fnOutput=highlighted}}if(!fnInputs){fnInputs=obj.type.inputs}if(!fnOutput){fnOutput=obj.type.output}const mappedNames=new Map();const whereClause=new Map();const fnParamNames=obj.paramNames;const queryParamNames=[];const remapQuery=queryElem=>{if(queryElem.id<0){queryParamNames[-1-queryElem.id]=queryElem.name}if(queryElem.generics.length>0){queryElem.generics.forEach(remapQuery)}if(queryElem.bindings.size>0){[...queryElem.bindings.values()].flat().forEach(remapQuery)}};parsedQuery.elems.forEach(remapQuery);parsedQuery.returned.forEach(remapQuery);const pushText=(fnType,result)=>{if(!!(result.length%2)===!!fnType.highlighted){result.push("")}else if(result.length===0&&!!fnType.highlighted){result.push("");result.push("")}result[result.length-1]+=fnType.name};const writeHof=(fnType,result)=>{const hofOutput=fnType.bindings.get(this.typeNameIdOfOutput)||[];const hofInputs=fnType.generics;pushText(fnType,result);pushText({name:" (",highlighted:false},result);let needsComma=false;for(const fnType of hofInputs){if(needsComma){pushText({name:", ",highlighted:false},result)}needsComma=true;writeFn(fnType,result)}pushText({name:hofOutput.length===0?")":") -> ",highlighted:false,},result);if(hofOutput.length>1){pushText({name:"(",highlighted:false},result)}needsComma=false;for(const fnType of hofOutput){if(needsComma){pushText({name:", ",highlighted:false},result)}needsComma=true;writeFn(fnType,result)}if(hofOutput.length>1){pushText({name:")",highlighted:false},result)}};const writeSpecialPrimitive=(fnType,result)=>{if(fnType.id===this.typeNameIdOfArray||fnType.id===this.typeNameIdOfSlice||fnType.id===this.typeNameIdOfTuple||fnType.id===this.typeNameIdOfUnit){const[ob,sb]=fnType.id===this.typeNameIdOfArray||fnType.id===this.typeNameIdOfSlice?["[","]"]:["(",")"];pushText({name:ob,highlighted:fnType.highlighted},result);onEachBtwn(fnType.generics,nested=>writeFn(nested,result),()=>pushText({name:", ",highlighted:false},result),);pushText({name:sb,highlighted:fnType.highlighted},result);return true}else if(fnType.id===this.typeNameIdOfReference){pushText({name:"&",highlighted:fnType.highlighted},result);let prevHighlighted=false;onEachBtwn(fnType.generics,value=>{prevHighlighted=value.highlighted;writeFn(value,result)},value=>pushText({name:" ",highlighted:prevHighlighted&&value.highlighted,},result),);return true}else if(fnType.id===this.typeNameIdOfFn){writeHof(fnType,result);return true}return false};const writeFn=(fnType,result)=>{if(fnType.id<0){if(fnParamNames[-1-fnType.id]===""){const generics=fnType.generics.length>0?fnType.generics:obj.type.where_clause[-1-fnType.id];for(const nested of generics){writeFn(nested,result)}return}else if(mgens){for(const[queryId,fnId]of mgens){if(fnId===fnType.id){mappedNames.set(queryParamNames[-1-queryId],fnParamNames[-1-fnType.id],)}}}pushText({name:fnParamNames[-1-fnType.id],highlighted:!!fnType.highlighted,},result);const where=[];onEachBtwn(fnType.generics,nested=>writeFn(nested,where),()=>pushText({name:" + ",highlighted:false},where),);if(where.length>0){whereClause.set(fnParamNames[-1-fnType.id],where)}}else{if(fnType.ty===TY_PRIMITIVE){if(writeSpecialPrimitive(fnType,result)){return}}else if(fnType.ty===TY_TRAIT&&(fnType.id===this.typeNameIdOfFn||fnType.id===this.typeNameIdOfFnMut||fnType.id===this.typeNameIdOfFnOnce)){writeHof(fnType,result);return}pushText(fnType,result);let hasBindings=false;if(fnType.bindings.size>0){onEachBtwn(fnType.bindings,([key,values])=>{const name=this.assocTypeIdNameMap.get(key);if(values.length===1&&values[0].id<0&&`${fnType.name}::${name}`===fnParamNames[-1-values[0].id]){for(const value of values){writeFn(value,[])}return true}if(!hasBindings){hasBindings=true;pushText({name:"<",highlighted:false},result)}pushText({name,highlighted:false},result);pushText({name:values.length!==1?"=(":"=",highlighted:false,},result);onEachBtwn(values||[],value=>writeFn(value,result),()=>pushText({name:" + ",highlighted:false},result),);if(values.length!==1){pushText({name:")",highlighted:false},result)}},()=>pushText({name:", ",highlighted:false},result),)}if(fnType.generics.length>0){pushText({name:hasBindings?", ":"<",highlighted:false},result)}onEachBtwn(fnType.generics,value=>writeFn(value,result),()=>pushText({name:", ",highlighted:false},result),);if(hasBindings||fnType.generics.length>0){pushText({name:">",highlighted:false},result)}}};const type=[];onEachBtwn(fnInputs,fnType=>writeFn(fnType,type),()=>pushText({name:", ",highlighted:false},type),);pushText({name:" -> ",highlighted:false},type);onEachBtwn(fnOutput,fnType=>writeFn(fnType,type),()=>pushText({name:", ",highlighted:false},type),);return{type,mappedNames,whereClause}};const sortResults=async(results,typeInfo,preferredCrate)=>{const userQuery=parsedQuery.userQuery;const normalizedUserQuery=parsedQuery.userQuery.toLowerCase();const isMixedCase=normalizedUserQuery!==userQuery;const result_list=[];const isReturnTypeQuery=parsedQuery.elems.length===0||typeInfo==="returned";for(const result of results.values()){result.item=this.searchIndex[result.id];result.word=this.searchIndex[result.id].word;if(isReturnTypeQuery){const hasType=result.item&&result.item.type;if(!hasType){continue}const inputs=result.item.type.inputs;const where_clause=result.item.type.where_clause;if(containsTypeFromQuery(inputs,where_clause)){result.path_dist*=100;result.dist*=100}}result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;if(isMixedCase){a=(aaa.item.name!==userQuery);b=(bbb.item.name!==userQuery);if(a!==b){return a-b}}a=(aaa.word!==normalizedUserQuery);b=(bbb.word!==normalizedUserQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}if(parsedQuery.hasReturnArrow){a=!isFnLikeTy(aaa.item.ty);b=!isFnLikeTy(bbb.item.ty);if(a!==b){return a-b}}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=this.searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex);b=this.searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=this.searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex);b=this.searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list,typeInfo)};function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return null}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return solutionCb(mgens)?fnTypesIn:null}if(!fnTypesIn||fnTypesIn.length===0){return null}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const[i,fnType]of fnTypesIn.entries()){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(queryElem.id)&&mgens.get(queryElem.id)!==fnType.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(queryElem.id,fnType.id);if(!solutionCb||solutionCb(mgensScratch)){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:whereClause[-1-fnType.id],});return highlighted}}else if(solutionCb(mgens?new Map(mgens):null)){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:unifyGenericTypes(fnType.generics,queryElem.generics,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth,)||fnType.generics,});return highlighted}}for(const[i,fnType]of fnTypesIn.entries()){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){const highlightedGenerics=unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgens,solutionCb,unboxingDepth+1,);if(highlightedGenerics){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({highlighted:true,},fnType,{generics:highlightedGenerics,});return highlighted}}else{const highlightedGenerics=unifyFunctionTypes([...Array.from(fnType.bindings.values()).flat(),...fnType.generics],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,);if(highlightedGenerics){const highlighted=[...fnTypesIn];highlighted[i]=Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),});return highlighted}}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(queryElem.id)&&mgensScratch.get(queryElem.id)!==fnType.id){continue}mgensScratch.set(queryElem.id,fnType.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}let unifiedGenerics=[];let unifiedGenericsMgens=null;const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){unifiedGenerics=unifyGenericTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(unifiedGenerics!==null){unifiedGenericsMgens=simplifiedMgens;return true}}return false},unboxingDepth,);if(passesUnification){passesUnification.length=fl;passesUnification[flast]=passesUnification[i];passesUnification[i]=Object.assign({},fnType,{highlighted:true,generics:unifiedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,queryElem.bindings.has(k)?unifyFunctionTypes(v,queryElem.bindings.get(k),whereClause,unifiedGenericsMgens,solutionCb,unboxingDepth,):unifiedGenerics.splice(0,v.length)]})),});return passesUnification}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...bindings,...generics),queryElems,whereClause,mgens,solutionCb,unboxingDepth+1,);if(passesUnification){const highlightedGenerics=passesUnification.slice(i,i+generics.length+bindings.length,);const highlightedFnType=Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),});return passesUnification.toSpliced(i,generics.length+bindings.length,highlightedFnType,)}}return null}function unifyGenericTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return null}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return solutionCb(mgens)?fnTypesIn:null}if(!fnTypesIn||fnTypesIn.length===0){return null}const fnType=fnTypesIn[0];const queryElem=queryElems[0];if(unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){if(fnType.id<0&&queryElem.id<0){if(!mgens||!mgens.has(queryElem.id)||mgens.get(queryElem.id)===fnType.id){const mgensScratch=new Map(mgens);mgensScratch.set(queryElem.id,fnType.id);const fnTypesRemaining=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(fnTypesRemaining){const highlighted=[fnType,...fnTypesRemaining];highlighted[0]=Object.assign({highlighted:true,},fnType,{generics:whereClause[-1-fnType.id],});return highlighted}}}else{let unifiedGenerics;const fnTypesRemaining=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgens,mgensScratch=>{const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){unifiedGenerics=unifyGenericTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(unifiedGenerics!==null){return true}}},unboxingDepth,);if(fnTypesRemaining){const highlighted=[fnType,...fnTypesRemaining];highlighted[0]=Object.assign({highlighted:true,},fnType,{generics:unifiedGenerics||fnType.generics,});return highlighted}}}if(unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){let highlightedRemaining;if(fnType.id<0){const highlightedGenerics=unifyFunctionTypes(whereClause[(-fnType.id)-1],[queryElem],whereClause,mgens,mgensScratch=>{const hl=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(hl){highlightedRemaining=hl}return hl},unboxingDepth+1,);if(highlightedGenerics){return[Object.assign({highlighted:true,},fnType,{generics:highlightedGenerics,}),...highlightedRemaining]}}else{const highlightedGenerics=unifyGenericTypes([...Array.from(fnType.bindings.values()).flat(),...fnType.generics,],[queryElem],whereClause,mgens,mgensScratch=>{const hl=unifyGenericTypes(fnTypesIn.slice(1),queryElems.slice(1),whereClause,mgensScratch,solutionCb,unboxingDepth,);if(hl){highlightedRemaining=hl}return hl},unboxingDepth+1,);if(highlightedGenerics){return[Object.assign({},fnType,{generics:highlightedGenerics,bindings:new Map([...fnType.bindings.entries()].map(([k,v])=>{return[k,highlightedGenerics.splice(0,v.length)]})),}),...highlightedRemaining]}}}return null}const unifyFunctionTypeIsMatchCandidate=(fnType,queryElem,mgensIn)=>{if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn&&mgensIn.has(queryElem.id)&&mgensIn.get(queryElem.id)!==fnType.id){return false}return true}else{if(queryElem.id===this.typeNameIdOfArrayOrSlice&&(fnType.id===this.typeNameIdOfSlice||fnType.id===this.typeNameIdOfArray)){}else if(queryElem.id===this.typeNameIdOfTupleOrUnit&&(fnType.id===this.typeNameIdOfTuple||fnType.id===this.typeNameIdOfUnit)){}else if(queryElem.id===this.typeNameIdOfHof&&(fnType.id===this.typeNameIdOfFn||fnType.id===this.typeNameIdOfFnMut||fnType.id===this.typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...binds,...simplifiedGenerics]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id<0){if(!whereClause){return false}return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgens,unboxingDepth,)}else if(fnType.unboxFlag&&(fnType.generics.length>0||fnType.bindings.size>0)){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function containsTypeFromQuery(list,where_clause){if(!list)return false;for(const ty of parsedQuery.returned){if(ty.id<0){continue}if(checkIfInList(list,ty,where_clause,null,0)){return true}}for(const ty of parsedQuery.elems){if(ty.id<0){continue}if(checkIfInList(list,ty,where_clause,null,0)){return true}}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}const checkType=(row,elem,whereClause,mgens,unboxingDepth)=>{if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&row.generics.length===0&&elem.generics.length===0&&row.bindings.size===0&&elem.bindings.size===0&&elem.id!==this.typeNameIdOfArrayOrSlice&&elem.id!==this.typeNameIdOfHof&&elem.id!==this.typeNameIdOfTupleOrUnit){return row.id===elem.id&&typePassesFilter(elem.typeFilter,row.ty)}else{return unifyFunctionTypes([row],[elem],whereClause,mgens,()=>true,unboxingDepth,)}};const checkTypeMgensForConflict=mgens=>{if(!mgens){return true}const fnTypes=new Set();for(const[_qid,fid]of mgens){if(fnTypes.has(fid)){return false}fnTypes.add(fid)}return true};function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}const handleAliases=async(ret,query,filterCrates,currentCrate)=>{const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(this.ALIASES.has(filterCrates)&&this.ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=this.ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(this.searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of this.ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(this.searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{return this.searchIndexEmptyDesc.get(alias.crate).contains(alias.bitIndex)?"":this.searchState.loadDesc(alias)};const[crateDescs,descs]=await Promise.all([Promise.all(crateAliases.map(fetchDesc)),Promise.all(aliases.map(fetchDesc)),]);const pushFunc=alias=>{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach((alias,i)=>{alias.desc=descs[i]});aliases.forEach(pushFunc);crateAliases.forEach((alias,i)=>{alias.desc=crateDescs[i]});crateAliases.forEach(pushFunc)};function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens,checkTypeMgensForConflict,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}const compareTypeFingerprints=(fullId,queryFingerprint)=>{const fh0=this.functionTypeFingerprint[fullId*4];const fh1=this.functionTypeFingerprint[(fullId*4)+1];const fh2=this.functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return this.functionTypeFingerprint[(fullId*4)+3]};const innerRunQuery=()=>{const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();const convertNameToId=(elem,isAssocType)=>{const loweredName=elem.pathLast.toLowerCase();if(this.typeNameIdMap.has(loweredName)&&(isAssocType||!this.typeNameIdMap.get(loweredName).assocOnly)){elem.id=this.typeNameIdMap.get(loweredName).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of this.typeNameIdMap){const dist=Math.min(editDistance(name,loweredName,maxEditDistance),editDistance(name,elem.normalizedPathLast,maxEditDistance),);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.normalizedPathLast)){elem.id=genericSymbols.get(elem.normalizedPathLast)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.normalizedPathLast,elem.id)}if(elem.typeFilter===-1&&elem.normalizedPathLast.length>=3){const maxPartDistance=Math.floor(elem.normalizedPathLast.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of this.typeNameIdMap.keys()){const dist=editDistance(name,elem.normalizedPathLast,maxPartDistance,);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!this.typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[this.typeNameIdMap.get(name).id,constraints]}),)};for(const elem of parsedQuery.elems){convertNameToId(elem);this.buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint)}for(const elem of parsedQuery.returned){convertNameToId(elem);this.buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint)}if(parsedQuery.foundElems===1&&!parsedQuery.hasReturnArrow){const elem=parsedQuery.elems[0];const handleNameSearch=id=>{const row=this.searchIndex[id];if(!typePassesFilter(elem.typeFilter,row.ty)||(filterCrates!==null&&row.crate!==filterCrates)){return}let pathDist=0;if(elem.fullPath.length>1){pathDist=checkPath(elem.pathWithoutLast,row);if(pathDist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,row.id,id,0,0,pathDist)}}else{addIntoResults(results_others,row.id,id,row.normalizedName.indexOf(elem.normalizedPathLast),editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance,),pathDist,maxEditDistance,)}};if(elem.normalizedPathLast!==""){const last=elem.normalizedPathLast;for(const id of this.nameTrie.search(last,this.tailTable)){handleNameSearch(id)}}const length=this.searchIndex.length;for(let i=0,nSearchIndex=length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=this.searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return this.searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":this.searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}}let rawSearchIndex;let docSearch;const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];let currentResults;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&window.searchIndex.has(elem.value)){return elem.value}return null}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement(array.length===0&&query.error===null?"div":"ul",);if(array.length>0){output.className="search-results "+extraClass;const lis=Promise.all(array.map(async item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("span");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ -${item.alias} - see \ -
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ -${item.displayPath}${name}\ -
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);if(item.displayTypeSignature){const{type,mappedNames,whereClause}=await item.displayTypeSignature;const displayType=document.createElement("div");type.forEach((value,index)=>{if(index%2!==0){const highlight=document.createElement("strong");highlight.appendChild(document.createTextNode(value));displayType.appendChild(highlight)}else{displayType.appendChild(document.createTextNode(value))}});if(mappedNames.size>0||whereClause.size>0){let addWhereLineFn=()=>{const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode("where"));displayType.appendChild(line);addWhereLineFn=()=>{}};for(const[qname,name]of mappedNames){if(name===qname){continue}addWhereLineFn();const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode(` ${qname} matches `));const lineStrong=document.createElement("strong");lineStrong.appendChild(document.createTextNode(name));line.appendChild(lineStrong);displayType.appendChild(line)}for(const[name,innerType]of whereClause){if(innerType.length<=1){continue}addWhereLineFn();const line=document.createElement("div");line.className="where";line.appendChild(document.createTextNode(` ${name}: `));innerType.forEach((value,index)=>{if(index%2!==0){const highlight=document.createElement("strong");highlight.appendChild(document.createTextNode(value));line.appendChild(highlight)}else{line.appendChild(document.createTextNode(value))}});displayType.appendChild(line)}}displayType.className="type-signature";link.appendChild(displayType)}link.appendChild(description);return link}));lis.then(lis=>{for(const li of lis){output.appendChild(li)}})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return output}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=DocSearch.parseQuery(searchState.input.value)}currentResults=results.query.userQuery;let currentTab=searchState.currentTab;if((currentTab===0&&results.others.length===0)||(currentTab===1&&results.in_args.length===0)||(currentTab===2&&results.returned.length===0)){if(results.others.length!==0){currentTab=0}else if(results.in_args.length){currentTab=1}else if(results.returned.length){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates="
in 
"+"
"}let output=`
\ -

Results

${crates}
`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",results.others.length)+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",results.others.length)+makeTabHeader(1,"In Parameters",results.in_args.length)+makeTabHeader(2,"In Return Types",results.returned.length)+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,results.others.length)+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,currentTab===0),addTab(results.in_args,results.query,currentTab===1),addTab(results.returned,results.query,currentTab===2),]);const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others);resultsElem.appendChild(ret_in_args);resultsElem.appendChild(ret_returned);search.innerHTML=output;if(searchState.rustdocToolbar){search.querySelector(".main-heading").appendChild(searchState.rustdocToolbar)}const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=DocSearch.parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="\""+query.userQuery+"\" Search - Rust";updateSearchHistory(buildUrl(query.userQuery,filterCrates));await showResults(await docSearch.execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}function initSearch(searchIndx){rawSearchIndex=searchIndx;if(typeof window!=="undefined"){docSearch=new DocSearch(rawSearchIndex,ROOT_PATH,searchState);registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}else if(typeof exports!=="undefined"){docSearch=new DocSearch(rawSearchIndex,ROOT_PATH,searchState);exports.docSearch=docSearch;exports.parseQuery=DocSearch.parseQuery}}if(typeof exports!=="undefined"){exports.initSearch=initSearch}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}class ParametricDescription{constructor(w,n,minErrors){this.w=w;this.n=n;this.minErrors=minErrors}isAccept(absState){const state=Math.floor(absState/(this.w+1));const offset=absState%(this.w+1);return this.w-offset+this.minErrors[state]<=this.n}getPosition(absState){return absState%(this.w+1)}getVector(name,charCode,pos,end){let vector=0;for(let i=pos;i>5;const bitStart=bitLoc&31;if(bitStart+bitsPerValue<=32){return((data[dataLoc]>>bitStart)&this.MASKS[bitsPerValue-1])}else{const part=32-bitStart;return ~~(((data[dataLoc]>>bitStart)&this.MASKS[part-1])+((data[1+dataLoc]&this.MASKS[bitsPerValue-part-1])< meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){const themeNames=getVar("themes").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}if(getSettingValue("hide-toc")==="true"){addClass(document.documentElement,"hide-toc")}if(getSettingValue("hide-modnav")==="true"){addClass(document.documentElement,"hide-modnav")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}});class RustdocSearchElement extends HTMLElement{constructor(){super()}connectedCallback(){const rootPath=getVar("root-path");const currentCrate=getVar("current-crate");this.innerHTML=``}}window.customElements.define("rustdoc-search",RustdocSearchElement);class RustdocToolbarElement extends HTMLElement{constructor(){super()}connectedCallback(){if(this.firstElementChild){return}const rootPath=getVar("root-path");this.innerHTML=` -
- Settings -
-
- Help -
- `}}window.customElements.define("rustdoc-toolbar",RustdocToolbarElement) \ No newline at end of file diff --git a/static.files/storage-c4642c8f.js b/static.files/storage-c4642c8f.js new file mode 100644 index 000000000..a645b0e28 --- /dev/null +++ b/static.files/storage-c4642c8f.js @@ -0,0 +1,23 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=(function(){const currentTheme=document.getElementById("themeStyle");return currentTheme instanceof HTMLLinkElement?currentTheme:null})();const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return!!elem&&!!elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.getAttribute("data-"+name):null}function switchTheme(newThemeName,saveTheme){const themeNames=(getVar("themes")||"").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(newThemeName===null||themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme&&window.currentTheme.parentNode){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=(function(){const currentTheme=document.getElementById("themeStyle");return currentTheme instanceof HTMLLinkElement?currentTheme:null})()}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&localStoredTheme!==null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}if(getSettingValue("hide-toc")==="true"){addClass(document.documentElement,"hide-toc")}if(getSettingValue("hide-modnav")==="true"){addClass(document.documentElement,"hide-modnav")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}});class RustdocSearchElement extends HTMLElement{constructor(){super()}connectedCallback(){const rootPath=getVar("root-path");const currentCrate=getVar("current-crate");this.innerHTML=``}}window.customElements.define("rustdoc-search",RustdocSearchElement);class RustdocToolbarElement extends HTMLElement{constructor(){super()}connectedCallback(){if(this.firstElementChild){return}const rootPath=getVar("root-path");this.innerHTML=` +
+ Settings +
+
+ Help +
+ `}}window.customElements.define("rustdoc-toolbar",RustdocToolbarElement) \ No newline at end of file