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
impl RobotSetConfigurationModule
Sourcepub fn new_empty() -> Self
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}
Sourcepub fn new_from_set_name(set_name: &str) -> Result<Self, OptimaError>
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}
pub fn add_robot_configuration_from_names( &mut self, robot_names: RobotNames<'_>, ) -> Result<(), OptimaError>
Sourcepub fn add_robot_configuration(
&mut self,
robot_configuration: RobotConfigurationModule,
) -> Result<(), OptimaError>
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}
pub fn robot_configuration_modules(&self) -> &Vec<RobotConfigurationModule>
pub fn robot_configuration_module( &self, idx: usize, ) -> Result<&RobotConfigurationModule, OptimaError>
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Examples found in repository?
More 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}
Sourcepub fn save_robot_set_configuration_module(
&self,
set_name: &str,
) -> Result<(), OptimaError>
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
impl RobotSetConfigurationModule
pub fn new_empty_py() -> Self
pub fn new_from_set_name_py(set_name: &str) -> Self
pub fn add_robot_configuration_from_names_py( &mut self, robot_name: &str, configuration_name: Option<&str>, )
pub fn add_robot_configuration_py( &mut self, robot_configuration: RobotConfigurationModulePy, )
pub fn save_robot_set_configuration_module_py(&self, set_name: &str)
pub fn num_robot_configurations(&self) -> usize
pub fn robot_configuration_modules_py( &self, py: Python<'_>, ) -> Vec<RobotConfigurationModulePy>
Trait Implementations§
Source§impl Clone for RobotSetConfigurationModule
impl Clone for RobotSetConfigurationModule
Source§fn clone(&self) -> RobotSetConfigurationModule
fn clone(&self) -> RobotSetConfigurationModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RobotSetConfigurationModule
impl Debug for RobotSetConfigurationModule
Source§impl<'de> Deserialize<'de> for RobotSetConfigurationModule
impl<'de> Deserialize<'de> for RobotSetConfigurationModule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PyClass for RobotSetConfigurationModule
impl PyClass for RobotSetConfigurationModule
Source§type BaseNativeType = PyAny
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
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}"
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
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§type Layout = PyCell<RobotSetConfigurationModule>
type Layout = PyCell<RobotSetConfigurationModule>
Layout
Source§type ThreadChecker = ThreadCheckerStub<RobotSetConfigurationModule>
type ThreadChecker = ThreadCheckerStub<RobotSetConfigurationModule>
This handles following two situations: Read more
fn for_all_items(visitor: &mut dyn FnMut(&PyClassItems))
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<RobotSetConfigurationModule> for PyClassImplCollector<RobotSetConfigurationModule>
impl PyMethods<RobotSetConfigurationModule> for PyClassImplCollector<RobotSetConfigurationModule>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for RobotSetConfigurationModule
impl PyTypeInfo for RobotSetConfigurationModule
Source§type AsRefTarget = PyCell<RobotSetConfigurationModule>
type AsRefTarget = PyCell<RobotSetConfigurationModule>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
PyTypeObject instance for this type.
Source§fn is_type_of(object: &PyAny) -> bool
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
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Source§impl SaveAndLoadable for RobotSetConfigurationModule
impl SaveAndLoadable for RobotSetConfigurationModule
type SaveType = Vec<String>
fn get_save_serialization_object(&self) -> Self::SaveType
fn load_from_json_string(json_str: &str) -> Result<Self, OptimaError>where
Self: Sized,
fn get_serialization_string(&self) -> String
fn save_to_path(&self, path: &OptimaStemCellPath) -> Result<(), OptimaError>
fn load_from_path(path: &OptimaStemCellPath) -> Result<Self, OptimaError>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for RobotSetConfigurationModule
impl RefUnwindSafe for RobotSetConfigurationModule
impl Send for RobotSetConfigurationModule
impl Sync for RobotSetConfigurationModule
impl Unpin for RobotSetConfigurationModule
impl UnwindSafe for RobotSetConfigurationModule
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset>,
) -> U
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 Twhere
T: SaveAndLoadable,
impl<T> AssetSaveAndLoadable for Twhere
T: SaveAndLoadable,
fn save_as_asset( &self, location: OptimaAssetLocation, ) -> Result<(), OptimaError>
fn load_as_asset(location: OptimaAssetLocation) -> Result<Self, OptimaError>where
Self: Sized,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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
impl<T> DowncastSync for T
Source§impl<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeObject for Twhere
T: PyTypeInfo,
impl<T> PyTypeObject for Twhere
T: PyTypeInfo,
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.