Struct RobotSetConfigurationModule

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

The robot set analogue of the RobotConfigurationModule. Multiple robot configurations can be added and configured in the set of robots here, then can be saved to a file for loading at a later time. This is a relatively simple wrapper around multiple RobotConfigurationModule objects that will be used to initialize many other robot set modules.

§Example

use optima::robot_modules::robot_configuration_module::{ContiguousChainMobilityMode, RobotConfigurationModule};
use optima::robot_set_modules::robot_set_configuration_module::RobotSetConfigurationModule;
use optima::utils::utils_robot::robot_module_utils::RobotNames;
use optima::utils::utils_se3::optima_se3_pose::{OptimaSE3Pose, OptimaSE3PoseType};

let mut r = RobotSetConfigurationModule::new_empty();

r.add_robot_configuration_from_names(RobotNames::new_base("ur5")).expect("error");
let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
sawyer_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {x_bounds: (-2.0, 2.0),y_bounds: (-2.0, 2.0)});
sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0.,1.0,0.,0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
r.add_robot_configuration(sawyer_configuration).expect("error");

r.save_robot_set_configuration_module("test_set").expect("error");

Implementations§

Source§

impl RobotSetConfigurationModule

Source

pub fn new_empty() -> Self

Examples found in repository?
examples/3_robot_set_configurations.rs (line 11)
9fn main() {
10    // Initialize `RobotSetConfigurationModule`
11    let mut robot_set_configuration_module = RobotSetConfigurationModule::new_empty();
12
13    // Load a base robot configuration module
14    let mut ur5_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("ur5")).expect("error");
15    // Set the ur5 to have a planar translation mobile base.
16    ur5_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {
17        x_bounds: (-2.0, 2.0),
18        y_bounds: (-2.0, 2.0)
19    }).expect("error");
20
21    // Add the ur5 configuration to the robot_set_configuration
22    robot_set_configuration_module.add_robot_configuration(ur5_configuration).expect("error");
23
24    let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
25    // Move the sawyer robot over 1 meter on the y axis so it is not overlapping with the ur5 robot.
26    sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0., 0., 1., 0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
27    // Remove the pedestal from the sawyer model.
28    sawyer_configuration.set_dead_end_link(2).expect("error");
29
30    // Add the sawyer configuration to the robot_set_configuration
31    robot_set_configuration_module.add_robot_configuration(sawyer_configuration).expect("error");
32
33    // Similar to a `RobotConfigurationModule`, a `RobotSetConfigurationModule` can be saved to a file
34    // to allow for easy loading of a model at a later time.  This command will save a file
35    // `optima_toolbox/optima_assets/optima_robot_sets/test_configuration.JSON`
36    robot_set_configuration_module.save_robot_set_configuration_module("test_configuration").expect("error");
37
38    // We will now load the just saved configuration
39    let loaded_robot_set_configuration_module = RobotSetConfigurationModule::new_from_set_name("test_configuration").expect("error");
40
41    // This loaded robot set configuration will now be used to initialize a `RobotSet`.
42    let robot_set = RobotSet::new_from_robot_set_configuration_module(loaded_robot_set_configuration_module);
43
44    // When we now print information about the robot set, the changes we made to the configurations
45    // are reflected in the combined model.
46    robot_set.print_summary();
47    robot_set.robot_set_configuration_module().print_summary();
48    robot_set.robot_set_joint_state_module().print_dof_summary();
49}
Source

pub fn new_from_set_name(set_name: &str) -> Result<Self, OptimaError>

Examples found in repository?
examples/3_robot_set_configurations.rs (line 39)
9fn main() {
10    // Initialize `RobotSetConfigurationModule`
11    let mut robot_set_configuration_module = RobotSetConfigurationModule::new_empty();
12
13    // Load a base robot configuration module
14    let mut ur5_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("ur5")).expect("error");
15    // Set the ur5 to have a planar translation mobile base.
16    ur5_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {
17        x_bounds: (-2.0, 2.0),
18        y_bounds: (-2.0, 2.0)
19    }).expect("error");
20
21    // Add the ur5 configuration to the robot_set_configuration
22    robot_set_configuration_module.add_robot_configuration(ur5_configuration).expect("error");
23
24    let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
25    // Move the sawyer robot over 1 meter on the y axis so it is not overlapping with the ur5 robot.
26    sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0., 0., 1., 0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
27    // Remove the pedestal from the sawyer model.
28    sawyer_configuration.set_dead_end_link(2).expect("error");
29
30    // Add the sawyer configuration to the robot_set_configuration
31    robot_set_configuration_module.add_robot_configuration(sawyer_configuration).expect("error");
32
33    // Similar to a `RobotConfigurationModule`, a `RobotSetConfigurationModule` can be saved to a file
34    // to allow for easy loading of a model at a later time.  This command will save a file
35    // `optima_toolbox/optima_assets/optima_robot_sets/test_configuration.JSON`
36    robot_set_configuration_module.save_robot_set_configuration_module("test_configuration").expect("error");
37
38    // We will now load the just saved configuration
39    let loaded_robot_set_configuration_module = RobotSetConfigurationModule::new_from_set_name("test_configuration").expect("error");
40
41    // This loaded robot set configuration will now be used to initialize a `RobotSet`.
42    let robot_set = RobotSet::new_from_robot_set_configuration_module(loaded_robot_set_configuration_module);
43
44    // When we now print information about the robot set, the changes we made to the configurations
45    // are reflected in the combined model.
46    robot_set.print_summary();
47    robot_set.robot_set_configuration_module().print_summary();
48    robot_set.robot_set_joint_state_module().print_dof_summary();
49}
Source

pub fn add_robot_configuration_from_names( &mut self, robot_names: RobotNames<'_>, ) -> Result<(), OptimaError>

Source

pub fn add_robot_configuration( &mut self, robot_configuration: RobotConfigurationModule, ) -> Result<(), OptimaError>

Examples found in repository?
examples/3_robot_set_configurations.rs (line 22)
9fn main() {
10    // Initialize `RobotSetConfigurationModule`
11    let mut robot_set_configuration_module = RobotSetConfigurationModule::new_empty();
12
13    // Load a base robot configuration module
14    let mut ur5_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("ur5")).expect("error");
15    // Set the ur5 to have a planar translation mobile base.
16    ur5_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {
17        x_bounds: (-2.0, 2.0),
18        y_bounds: (-2.0, 2.0)
19    }).expect("error");
20
21    // Add the ur5 configuration to the robot_set_configuration
22    robot_set_configuration_module.add_robot_configuration(ur5_configuration).expect("error");
23
24    let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
25    // Move the sawyer robot over 1 meter on the y axis so it is not overlapping with the ur5 robot.
26    sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0., 0., 1., 0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
27    // Remove the pedestal from the sawyer model.
28    sawyer_configuration.set_dead_end_link(2).expect("error");
29
30    // Add the sawyer configuration to the robot_set_configuration
31    robot_set_configuration_module.add_robot_configuration(sawyer_configuration).expect("error");
32
33    // Similar to a `RobotConfigurationModule`, a `RobotSetConfigurationModule` can be saved to a file
34    // to allow for easy loading of a model at a later time.  This command will save a file
35    // `optima_toolbox/optima_assets/optima_robot_sets/test_configuration.JSON`
36    robot_set_configuration_module.save_robot_set_configuration_module("test_configuration").expect("error");
37
38    // We will now load the just saved configuration
39    let loaded_robot_set_configuration_module = RobotSetConfigurationModule::new_from_set_name("test_configuration").expect("error");
40
41    // This loaded robot set configuration will now be used to initialize a `RobotSet`.
42    let robot_set = RobotSet::new_from_robot_set_configuration_module(loaded_robot_set_configuration_module);
43
44    // When we now print information about the robot set, the changes we made to the configurations
45    // are reflected in the combined model.
46    robot_set.print_summary();
47    robot_set.robot_set_configuration_module().print_summary();
48    robot_set.robot_set_joint_state_module().print_dof_summary();
49}
Source

pub fn robot_configuration_modules(&self) -> &Vec<RobotConfigurationModule>

Source

pub fn robot_configuration_module( &self, idx: usize, ) -> Result<&RobotConfigurationModule, OptimaError>

Source

pub fn print_summary(&self)

Examples found in repository?
examples/2_robot_sets.rs (line 11)
6fn main() {
7    // Loads a robot set with two robots (a ur5 and sawyer).
8    let robot_set = RobotSet::new_from_robot_names(vec![RobotNames::new("ur5", None), RobotNames::new("sawyer", None)]);
9
10    // prints a summary of the robot set configuration
11    robot_set.robot_set_configuration_module().print_summary();
12
13    // prints a summary of the robot set's degrees of freedom.
14    robot_set.robot_set_joint_state_module().print_dof_summary();
15}
More examples
Hide additional examples
examples/3_robot_set_configurations.rs (line 47)
9fn main() {
10    // Initialize `RobotSetConfigurationModule`
11    let mut robot_set_configuration_module = RobotSetConfigurationModule::new_empty();
12
13    // Load a base robot configuration module
14    let mut ur5_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("ur5")).expect("error");
15    // Set the ur5 to have a planar translation mobile base.
16    ur5_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {
17        x_bounds: (-2.0, 2.0),
18        y_bounds: (-2.0, 2.0)
19    }).expect("error");
20
21    // Add the ur5 configuration to the robot_set_configuration
22    robot_set_configuration_module.add_robot_configuration(ur5_configuration).expect("error");
23
24    let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
25    // Move the sawyer robot over 1 meter on the y axis so it is not overlapping with the ur5 robot.
26    sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0., 0., 1., 0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
27    // Remove the pedestal from the sawyer model.
28    sawyer_configuration.set_dead_end_link(2).expect("error");
29
30    // Add the sawyer configuration to the robot_set_configuration
31    robot_set_configuration_module.add_robot_configuration(sawyer_configuration).expect("error");
32
33    // Similar to a `RobotConfigurationModule`, a `RobotSetConfigurationModule` can be saved to a file
34    // to allow for easy loading of a model at a later time.  This command will save a file
35    // `optima_toolbox/optima_assets/optima_robot_sets/test_configuration.JSON`
36    robot_set_configuration_module.save_robot_set_configuration_module("test_configuration").expect("error");
37
38    // We will now load the just saved configuration
39    let loaded_robot_set_configuration_module = RobotSetConfigurationModule::new_from_set_name("test_configuration").expect("error");
40
41    // This loaded robot set configuration will now be used to initialize a `RobotSet`.
42    let robot_set = RobotSet::new_from_robot_set_configuration_module(loaded_robot_set_configuration_module);
43
44    // When we now print information about the robot set, the changes we made to the configurations
45    // are reflected in the combined model.
46    robot_set.print_summary();
47    robot_set.robot_set_configuration_module().print_summary();
48    robot_set.robot_set_joint_state_module().print_dof_summary();
49}
Source

pub fn save_robot_set_configuration_module( &self, set_name: &str, ) -> Result<(), OptimaError>

Robot set configurations are saved to the optima_assets/optima_robot_sets directory.

Examples found in repository?
examples/3_robot_set_configurations.rs (line 36)
9fn main() {
10    // Initialize `RobotSetConfigurationModule`
11    let mut robot_set_configuration_module = RobotSetConfigurationModule::new_empty();
12
13    // Load a base robot configuration module
14    let mut ur5_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("ur5")).expect("error");
15    // Set the ur5 to have a planar translation mobile base.
16    ur5_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {
17        x_bounds: (-2.0, 2.0),
18        y_bounds: (-2.0, 2.0)
19    }).expect("error");
20
21    // Add the ur5 configuration to the robot_set_configuration
22    robot_set_configuration_module.add_robot_configuration(ur5_configuration).expect("error");
23
24    let mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base("sawyer")).expect("error");
25    // Move the sawyer robot over 1 meter on the y axis so it is not overlapping with the ur5 robot.
26    sawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0., 0., 1., 0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect("error");
27    // Remove the pedestal from the sawyer model.
28    sawyer_configuration.set_dead_end_link(2).expect("error");
29
30    // Add the sawyer configuration to the robot_set_configuration
31    robot_set_configuration_module.add_robot_configuration(sawyer_configuration).expect("error");
32
33    // Similar to a `RobotConfigurationModule`, a `RobotSetConfigurationModule` can be saved to a file
34    // to allow for easy loading of a model at a later time.  This command will save a file
35    // `optima_toolbox/optima_assets/optima_robot_sets/test_configuration.JSON`
36    robot_set_configuration_module.save_robot_set_configuration_module("test_configuration").expect("error");
37
38    // We will now load the just saved configuration
39    let loaded_robot_set_configuration_module = RobotSetConfigurationModule::new_from_set_name("test_configuration").expect("error");
40
41    // This loaded robot set configuration will now be used to initialize a `RobotSet`.
42    let robot_set = RobotSet::new_from_robot_set_configuration_module(loaded_robot_set_configuration_module);
43
44    // When we now print information about the robot set, the changes we made to the configurations
45    // are reflected in the combined model.
46    robot_set.print_summary();
47    robot_set.robot_set_configuration_module().print_summary();
48    robot_set.robot_set_joint_state_module().print_dof_summary();
49}
Source§

impl RobotSetConfigurationModule

Source

pub fn new_empty_py() -> Self

Source

pub fn new_from_set_name_py(set_name: &str) -> Self

Source

pub fn add_robot_configuration_from_names_py( &mut self, robot_name: &str, configuration_name: Option<&str>, )

Source

pub fn add_robot_configuration_py( &mut self, robot_configuration: RobotConfigurationModulePy, )

Source

pub fn save_robot_set_configuration_module_py(&self, set_name: &str)

Source

pub fn num_robot_configurations(&self) -> usize

Source

pub fn robot_configuration_modules_py( &self, py: Python<'_>, ) -> Vec<RobotConfigurationModulePy>

Trait Implementations§

Source§

impl Clone for RobotSetConfigurationModule

Source§

fn clone(&self) -> RobotSetConfigurationModule

Returns a duplicate 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 RobotSetConfigurationModule

Source§

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

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

impl<'de> Deserialize<'de> for RobotSetConfigurationModule

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 IntoPy<Py<PyAny>> for RobotSetConfigurationModule

Source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
Source§

impl PyClass for RobotSetConfigurationModule

Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

impl PyClassImpl for RobotSetConfigurationModule

Source§

const DOC: &'static str = "The robot set analogue of the `RobotConfigurationModule`. Multiple robot configurations\ncan be added and configured in the set of robots here, then can be saved to a file for loading\nat a later time. This is a relatively simple wrapper around multiple `RobotConfigurationModule`\nobjects that will be used to initialize many other robot set modules.\n\n# Example\n```text\nuse optima::robot_modules::robot_configuration_module::{ContiguousChainMobilityMode, RobotConfigurationModule};\nuse optima::robot_set_modules::robot_set_configuration_module::RobotSetConfigurationModule;\nuse optima::utils::utils_robot::robot_module_utils::RobotNames;\nuse optima::utils::utils_se3::optima_se3_pose::{OptimaSE3Pose, OptimaSE3PoseType};\n\nlet mut r = RobotSetConfigurationModule::new_empty();\n\nr.add_robot_configuration_from_names(RobotNames::new_base(\"ur5\")).expect(\"error\");\nlet mut sawyer_configuration = RobotConfigurationModule::new_from_names(RobotNames::new_base(\"sawyer\")).expect(\"error\");\nsawyer_configuration.set_mobile_base(ContiguousChainMobilityMode::PlanarTranslation {x_bounds: (-2.0, 2.0),y_bounds: (-2.0, 2.0)});\nsawyer_configuration.set_base_offset(&OptimaSE3Pose::new_from_euler_angles(0.,0.,0.,1.0,0.,0., &OptimaSE3PoseType::ImplicitDualQuaternion)).expect(\"error\");\nr.add_robot_configuration(sawyer_configuration).expect(\"error\");\n\nr.save_robot_set_configuration_module(\"test_set\").expect(\"error\");\n```\u{0}"

Class doc string
Source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

type Layout = PyCell<RobotSetConfigurationModule>

Layout
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = ThreadCheckerStub<RobotSetConfigurationModule>

This handles following two situations: Read more
Source§

fn for_all_items(visitor: &mut dyn FnMut(&PyClassItems))

Source§

fn dict_offset() -> Option<isize>

Source§

fn weaklist_offset() -> Option<isize>

Source§

impl PyMethods<RobotSetConfigurationModule> for PyClassImplCollector<RobotSetConfigurationModule>

Source§

fn py_methods(self) -> &'static PyClassItems

Source§

impl PyTypeInfo for RobotSetConfigurationModule

Source§

const NAME: &'static str = "RobotSetConfigurationModule"

Class name.
Source§

const MODULE: Option<&'static str> = ::core::option::Option::None

Module name, if any.
Source§

type AsRefTarget = PyCell<RobotSetConfigurationModule>

Utility type to make Py::as_ref work.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

PyTypeObject instance for this type.
Source§

fn is_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type or a subclass of this type.
Source§

fn is_exact_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type.
Source§

impl SaveAndLoadable for RobotSetConfigurationModule

Source§

impl Serialize for RobotSetConfigurationModule

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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type( &self, _images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset>, ) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
Source§

impl<T> AssetSaveAndLoadable for T
where T: SaveAndLoadable,

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromPyObject<'a> for T
where T: PyClass + Clone,

Source§

fn extract(obj: &'a PyAny) -> Result<T, PyErr>

Extracts Self from the source PyObject.
Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> PyTypeObject for T
where T: PyTypeInfo,

Source§

fn type_object(py: Python<'_>) -> &PyType

Returns the safe abstraction over the type object.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToAndFromJsonString for T

Source§

fn to_json_string(&self) -> String

Source§

fn from_json_string(json_str: &str) -> Result<Self, OptimaError>
where Self: Sized,

Source§

impl<T> ToAndFromRonString for T

Source§

fn to_ron_string(&self) -> String

Source§

fn from_ron_string(ron_str: &str) -> Result<Self, OptimaError>
where Self: Sized,

Source§

impl<T> ToAndFromTomlString for T

Source§

fn to_toml_string(&self) -> String

Source§

fn from_toml_string(toml_string: &str) -> Result<Self, OptimaError>
where Self: Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

impl<T> Event for T
where T: Send + Sync + 'static,

Source§

impl<T> Resource for T
where T: Send + Sync + 'static,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T> Ungil for T
where T: Send,