Skip to main content

Robot

Struct Robot 

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

Maintains a network connection to the robot, provides the current robot state, gives access to the robot model and allows to control the robot.

Port of franka::Robot.

Implementations§

Source§

impl Robot

Source

pub fn start_cartesian_target_control( self: &Arc<Self>, options: TargetControlOptions, ) -> FrankaResult<CartesianTargetControl>

Starts a Cartesian target control loop on its own thread and returns once its first cycle has anchored on the current pose (the model’s pose of the measured configuration with Backend::Impedance, the commanded one with Backend::RobotController); see the module documentation.

§Errors

FrankaError::InvalidArgument if the options are invalid, FrankaError::Realtime if the loop thread cannot be raised to SCHED_FIFO under RealtimeConfig::Enforce, whatever Robot::load_model fails with under Backend::Impedance, and whatever Robot::control_torques or Robot::control_cartesian_pose fails with before its first cycle, FrankaError::InvalidOperation if another control or read operation is running among them.

Source

pub fn start_joint_target_control( self: &Arc<Self>, options: JointTargetControlOptions, ) -> FrankaResult<JointTargetControl>

Starts a joint target control loop on its own thread and returns once its first cycle has anchored on the current joint positions; see the module documentation.

§Errors

As Robot::start_cartesian_target_control, with Robot::control_joint_positions as the Backend::RobotController loop.

Source§

impl Robot

Source

pub fn start_torque_control(&self) -> FrankaResult<ActiveTorqueControl<'_>>

Starts an external torque control process driven by ActiveTorqueControl::read_once / ActiveTorqueControl::write_once.

§Errors

FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Control if a motion is already running on the robot.

Source

pub fn start_joint_position_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, JointPositions>>

Starts an externally driven joint position motion.

Source

pub fn start_joint_velocity_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, JointVelocities>>

Starts an externally driven joint velocity motion.

Source

pub fn start_cartesian_pose_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, CartesianPose>>

Starts an externally driven Cartesian pose motion.

Source

pub fn start_cartesian_velocity_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, CartesianVelocities>>

Starts an externally driven Cartesian velocity motion.

Source§

impl Robot

Source

pub fn control_torques<C>( &self, control_callback: C, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for sending joint-level torque commands.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to torque control or motion generation occurred, FrankaError::InvalidArgument if joint-level torque commands are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

§FCI v5

An FER has no torque-only motion generator mode, so this runs libfranka 0.9.2’s scheme (src/robot.cpp:41-57): a joint-velocity motion generator commanding all-zero velocities alongside the external controller, ended with motion_generation_finished. The two callbacks are also evaluated in 0.9.2’s order (motion first, controller short-circuited) rather than 0.21.2’s.

Source

pub fn control_torques_and_joint_positions<C, M>( &self, control_callback: C, motion_callback: M, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a joint position motion generator with an external controller.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to torque control or motion generation occurred, FrankaError::InvalidArgument if joint-level torque or joint position commands are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

§FCI v5

On an FER the first setpoint of the motion is rate limited against the robot’s own q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion (src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first setpoint is its own reference and therefore passes the limiter unchanged, which is libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from (close to) the current pose either way.

Source

pub fn control_torques_and_joint_velocities<C, M>( &self, control_callback: C, motion_callback: M, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a joint velocity motion generator with an external controller.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to torque control or motion generation occurred, FrankaError::InvalidArgument if joint-level torque or joint velocity commands are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

Source

pub fn control_torques_and_cartesian_pose<C, M>( &self, control_callback: C, motion_callback: M, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a Cartesian pose motion generator with an external controller.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to torque control or motion generation occurred, FrankaError::InvalidArgument if joint-level torque or Cartesian pose command elements are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

§FCI v5

On an FER the first setpoint of the motion is rate limited against the robot’s own q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion (src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first setpoint is its own reference and therefore passes the limiter unchanged, which is libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from (close to) the current pose either way.

Source

pub fn control_torques_and_cartesian_velocities<C, M>( &self, control_callback: C, motion_callback: M, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a Cartesian velocity motion generator with an external controller.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to torque control or motion generation occurred, FrankaError::InvalidArgument if joint-level torque or Cartesian velocity command elements are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

Source

pub fn control_joint_positions<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a joint position motion generator with one of the robot’s internal controllers.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to motion generation occurred, FrankaError::InvalidArgument if joint position commands are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

§FCI v5

On an FER the first setpoint of the motion is rate limited against the robot’s own q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion (src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first setpoint is its own reference and therefore passes the limiter unchanged, which is libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from (close to) the current pose either way.

Source

pub fn control_joint_velocities<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a joint velocity motion generator with one of the robot’s internal controllers.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to motion generation occurred, FrankaError::InvalidArgument if joint velocity commands are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

Source

pub fn control_cartesian_pose<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a Cartesian pose motion generator with one of the robot’s internal controllers.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to motion generation occurred, FrankaError::InvalidArgument if Cartesian pose command elements are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

§FCI v5

On an FER the first setpoint of the motion is rate limited against the robot’s own q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion (src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first setpoint is its own reference and therefore passes the limiter unchanged, which is libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from (close to) the current pose either way.

Source

pub fn control_cartesian_velocities<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>

Starts a control loop for a Cartesian velocity motion generator with one of the robot’s internal controllers.

limit_rate enables the client-side rate limiter and cutoff_frequency the first-order low-pass filter applied to the commanded signal (pass crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).

libfranka 0.21 default: false (0.9: true); pass true to enable the client-side limiter – it could distort your motion. libfranka’s cutoff_frequency default is crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so both are always passed explicitly here.

§Errors

FrankaError::Control if an error related to motion generation occurred, FrankaError::InvalidArgument if Cartesian velocity command elements are NaN or infinity, FrankaError::InvalidOperation if another control or read operation is running, FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike libfranka’s control this never fails with FrankaError::Realtime: realtime priority is raised in Robot::new, matching libfranka’s Robot::Impl constructor.

Source§

impl Robot

Source

pub fn new( franka_address: &str, realtime_config: RealtimeConfig, ) -> FrankaResult<Robot>

Establishes a connection with the robot.

franka_address is the IP/hostname of the robot, optionally with a ":port" suffix; without one the FCI command port 1337 is used.

§Errors

FrankaError::Network if the connection could not be established, FrankaError::IncompatibleVersion if the robot speaks another FCI version, FrankaError::Realtime with RealtimeConfig::Enforce if realtime priority or a realtime kernel is unavailable.

Source

pub fn new_with_log_size( franka_address: &str, realtime_config: RealtimeConfig, log_size: usize, ) -> FrankaResult<Robot>

Robot::new with an explicit size for the control log that is attached to a crate::error::ControlException; 0 disables logging.

Source

pub fn with_options( franka_address: &str, options: RobotOptions, ) -> FrankaResult<Robot>

Robot::new with an explicit RobotOptions, which is how a Franka Emika Robot (FER) (FCI v5) is connected.

§Example
use franka::{FciVersion, RealtimeConfig, Robot, RobotOptions, VersionPolicy};

let options = RobotOptions::new(RealtimeConfig::Ignore)
    .with_version(VersionPolicy::Exact(FciVersion::V5));
let robot = Robot::with_options("192.168.0.1", options)?;
assert_eq!(robot.fci_version(), FciVersion::V5);
Source

pub fn server_version(&self) -> u16

Returns the software version reported by the connected server.

Source

pub fn fci_version(&self) -> FciVersion

The FCI protocol version this connection negotiated.

Source

pub fn read_once(&self) -> FrankaResult<RobotState>

Waits for a robot state arriving over the UDP stream and returns it.

Unlike Robot::read this does not take the control lock, so it can be called while nothing else is running.

Source

pub fn read<F: FnMut(&RobotState) -> bool>( &self, read_callback: F, ) -> FrankaResult<()>

Starts a loop for reading the current robot state.

The callback is invoked for every received state; returning false ends the loop.

§Errors

FrankaError::InvalidOperation if another control or read operation is running.

Source

pub fn robot_model(&self) -> FrankaResult<String>

Returns the robot’s URDF model as a string (GetRobotModel).

§Errors

FrankaError::InvalidOperation on FCI v5, which has no GetRobotModel; an FER serves its model as a shared object, so use Robot::load_model there.

Source

pub fn load_model(&self) -> FrankaResult<Model>

Loads the kinematic and dynamic model of the connected robot.

Neither version downloads executable code:

  • FCI v10 (FR3) asks the robot for its URDF (GetRobotModel) and evaluates it with the native backend.
  • FCI v5 (FER) has no GetRobotModel, and this returns Model::native_fer — the same native backend over the built-in crate::model::FER_URDF, whose inertial parameters were identified from an FER’s own libfcimodels_x64.so. Nothing is fetched, so this cannot fail, needs no model-library feature and works on any host.

Use Robot::load_model_from_robot to download and dlopen the FER’s own shared object instead, which is what libfranka 0.9.2 does and what franka-rs did before. The two agree on kinematics to 9e-16 and on gravity to 5e-14; with a payload attached their mass matrices differ by up to 3e-3 kg m^2, because the shared object’s M_NE is not a rigid-body model of the payload. See docs/book/src/reference/model.md.

§Errors

FrankaError::Model if the model cannot be obtained or parsed; FrankaError::Network / FrankaError::Protocol for the usual command-socket failures. On FCI v5 none of these can happen.

Source

pub fn load_model_from_robot(&self) -> FrankaResult<Model>

Loads the model the robot itself serves.

On FCI v10 this is Robot::load_model exactly: an FR3 serves a URDF. On FCI v5 it is libfranka 0.9.2’s behaviour — LoadModelLibrary downloads libfcimodels.so and the client dlopens it.

§Security

On FCI v5 (FER) this downloads a shared object served by the robot, writes it to a temporary file and dlopens it — that is, it executes native code chosen by the FCI peer, in this process, with this process’s privileges. Nothing validates the blob: the command socket is plaintext TCP with no authentication, and there is no signature to check.

This is deliberate, and it is exactly what libfranka 0.9.2 does (franka::Model::Model(Network&) -> LibraryDownloader -> LibraryLoader): the FCI peer is already fully trusted, because it is the thing that commands the arm. Anyone who can impersonate the robot on this socket can already move it. So the method stays safe, like libfranka’s, and the trust boundary is the network you put the robot on: give the FCI its own isolated link, as Franka’s own setup guide requires.

To opt out, use Robot::load_model, which needs no download at all, or build without the default model-library feature — then this method returns FrankaError::Model on an FER instead of loading anything, and libloading is not linked at all. FCI v10 is unaffected either way: an FR3 serves a URDF, which is parsed, not executed.

Model::from_model_library_bytes and Model::from_model_library_path (both model-library only) expose the same load as unsafe fns, for callers who supply the bytes themselves.

§Errors

FrankaError::Model if the model cannot be obtained, parsed, saved or loaded; FrankaError::Network / FrankaError::Protocol for the usual command-socket failures.

Source

pub fn set_filters( &self, joint_position_filter_frequency: f64, joint_velocity_filter_frequency: f64, cartesian_position_filter_frequency: f64, cartesian_velocity_filter_frequency: f64, controller_filter_frequency: f64, ) -> FrankaResult<()>

Sets the cut-off frequencies of the robot-side filters, in hertz (Robot::setFilters).

§Errors

FrankaError::InvalidOperation on FCI v10, which dropped the command; FrankaError::Command if the robot rejected it.

Source

pub fn virtual_wall(&self, id: i32) -> FrankaResult<VirtualWallCuboid>

Returns the parameters of the virtual wall with the given id (Robot::getVirtualWall).

§Errors

FrankaError::InvalidOperation on FCI v10, which dropped the command; FrankaError::Command if the robot rejected it.

Source

pub fn stop(&self) -> FrankaResult<()>

Stops all currently running motions.

Can be called from a second thread while a control loop is running; the control loop then fails with a FrankaError::Control carrying "libfranka: Move command preempted!".

§Errors

FrankaError::Command if the robot rejected the StopMove.

Source

pub fn automatic_error_recovery(&self) -> FrankaResult<()>

Runs automatic error recovery on the robot, clearing the errors of a reflex or a collision so that a new motion can be started.

§Errors

FrankaError::Command if the robot rejected the command, e.g. because manual error recovery is required.

Source

pub fn set_collision_behavior( &self, lower_torque_thresholds_acceleration: [f64; 7], upper_torque_thresholds_acceleration: [f64; 7], lower_torque_thresholds_nominal: [f64; 7], upper_torque_thresholds_nominal: [f64; 7], lower_force_thresholds_acceleration: [f64; 6], upper_force_thresholds_acceleration: [f64; 6], lower_force_thresholds_nominal: [f64; 6], upper_force_thresholds_nominal: [f64; 6], ) -> FrankaResult<()>

Changes the collision behavior.

Set separate torque and force boundaries for acceleration/deceleration and constant velocity movement phases. Forces or torques between lower and upper threshold are shown as contacts in the robot state; above the upper threshold the robot stops and enters an error state.

§Errors

FrankaError::Command if the robot rejected the command.

Source

pub fn set_collision_behavior_simple( &self, lower_torque_thresholds: [f64; 7], upper_torque_thresholds: [f64; 7], lower_force_thresholds: [f64; 6], upper_force_thresholds: [f64; 6], ) -> FrankaResult<()>

Robot::set_collision_behavior with the same thresholds for the acceleration and the constant velocity phase.

Source

pub fn set_joint_impedance(&self, K_theta: [f64; 7]) -> FrankaResult<()>

Sets the impedance for each joint in the internal controller [Nm/rad].

User-provided torques are not affected by this setting.

Source

pub fn set_cartesian_impedance(&self, K_x: [f64; 6]) -> FrankaResult<()>

Sets the Cartesian impedance for (x, y, z, roll, pitch, yaw) in the internal controller.

User-provided torques are not affected by this setting.

Source

pub fn set_guiding_mode( &self, guiding_mode: [bool; 6], elbow: bool, ) -> FrankaResult<()>

Locks or unlocks guiding mode movement in (x, y, z, roll, pitch, yaw).

If elbow is true the elbow is locked and the flag for the 3rd and 5th joint is ignored.

Source

pub fn set_k(&self, EE_T_K: [f64; 16]) -> FrankaResult<()>

Sets the transformation from the end effector frame EE to the stiffness frame K, column-major.

Source

pub fn set_ee(&self, NE_T_EE: [f64; 16]) -> FrankaResult<()>

Sets the transformation from the nominal end effector frame NE to the end effector frame EE, column-major.

The transformation from flange to NE is set in Desk.

Source

pub fn set_load( &self, load_mass: f64, F_x_Cload: [f64; 3], load_inertia: [f64; 9], ) -> FrankaResult<()>

Sets dynamic parameters of a payload: mass in [kg], centre of mass in the flange frame and the inertia matrix with respect to the centre of mass, column-major.

This is not for setting end effector parameters, which have to be set in the administrator’s interface.

Source

pub fn upper_joint_velocity_limits(&self, q: &[f64; 7]) -> [f64; 7]

Position-dependent upper joint velocity limits at q, as used by the rate limiter.

Source

pub fn lower_joint_velocity_limits(&self, q: &[f64; 7]) -> [f64; 7]

Position-dependent lower joint velocity limits at q, as used by the rate limiter.

Trait Implementations§

Source§

impl Debug for Robot

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Robot

§

impl RefUnwindSafe for Robot

§

impl Send for Robot

§

impl Sync for Robot

§

impl Unpin for Robot

§

impl UnsafeUnpin for Robot

§

impl UnwindSafe for Robot

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.