Struct FlightComputer

Source
pub struct FlightComputer {
    current_pos: Vec2D<I32F32>,
    current_vel: Vec2D<I32F32>,
    current_state: FlightState,
    target_state: Option<FlightState>,
    current_angle: CameraAngle,
    current_battery: I32F32,
    max_battery: I32F32,
    fuel_left: I32F32,
    last_observation_timestamp: DateTime<Utc>,
    request_client: Arc<HTTPClient>,
}
Expand description

Represents the core flight computer for satellite control. It manages operations such as state changes, velocity updates, battery charging.

This system interfaces with an external HTTP-based control system to send requests for managing the satellite’s behavior (e.g., velocity updates, state transitions). Additionally, the file schedules satellite-related activities like image captures and ensures the system stays updated using observations.

Key methods allow high-level control, including state transitions, camera angle adjustments, and battery-related tasks.

Fields§

§current_pos: Vec2D<I32F32>

Current position of the satellite in 2D space.

§current_vel: Vec2D<I32F32>

Current velocity of the satellite in 2D space.

§current_state: FlightState

Current state of the satellite based on FlightState.

§target_state: Option<FlightState>

Target State if current_state is FlightState::Transition

§current_angle: CameraAngle

Current angle of the satellite’s camera (e.g., Narrow, Normal, Wide).

§current_battery: I32F32

Current battery level of the satellite.

§max_battery: I32F32

Maximum battery capacity of the satellite.

§fuel_left: I32F32

Remaining fuel level for the satellite operations.

§last_observation_timestamp: DateTime<Utc>

Timestamp marking the last observation update from the satellite.

§request_client: Arc<HTTPClient>

HTTP client for sending requests for satellite operations.

Implementations§

Source§

impl FlightComputer

Source

pub const MIN_0: I32F32 = I32F32::ZERO

A constant I32F32 0.0 value for fuel and battery min values

Source

pub const MAX_100: I32F32

A constant I32F32 100.0 value for fuel and battery max values

Source

pub const ACC_CONST: I32F32

Constant acceleration in target velocity vector direction

Source

pub const FUEL_CONST: I32F32

Constant fuel consumption per accelerating second

Source

pub const VEL_BE_MAX_DECIMAL: u8 = 2u8

Maximum decimal places that are used in the observation endpoint for velocity

Source

const DEF_COND_TO: u32 = 3_000u32

Constant timeout for the wait_for_condition-method

Source

const DEF_COND_PI: u16 = 500u16

Constant timeout for the wait_for_condition-method

Source

const TO_SAFE_SLEEP: Duration

Constant transition to SAFE sleep time for all states

Source

const MAX_OR_VEL_CHANGE_ABS: I32F32

Maximum absolute vel change for orbit return

Source

const MAX_OR_VEL_CHANGE_DEV: I32F32

Deviation at which MAX_VEL_CHANGE_ABS should occur

Source

const MAX_OR_ACQ_ACC_TIME: I32F32

Maximum acceleration time needed for orbit return maneuvers (this is 2*50s, as we only change velocity by 1.0, and 10s for minor maneuvers)

Source

const MAX_OR_ACQ_TIME: I32F32

Maximum time spend in acquisition between burns for orbit returns (this is the distance travelled during acceleration/brake (2*25) which leaves a maximum of 110 at max speed according to MAX_OR_VEL_CHANGE_DEV)

Source

const AFTER_SAFE_MIN_BATT: I32F32

Minimum battery used in decision-making for after safe transition

Source

const EXIT_SAFE_MIN_BATT: I32F32

Minimum battery needed to exit safe mode

Source

const DEF_BRAKE_ABS: I32F32

Maximum absolute break velocity change

Source

const MAX_DETUMBLE_DT: TimeDelta

Maximum burn time for detumbling

Source

const LEGAL_TARGET_STATES: [FlightState; 3]

Legal Target States for State Change

Source

pub fn one_time_safe(&mut self)

Debug method used to emulate a safe mode event

Source

pub async fn new(request_client: Arc<HTTPClient>) -> FlightComputer

Initializes a new FlightComputer instance.

§Arguments
  • request_client: A reference to the HTTP client for sending simulation requests.
§Returns

A fully initialized FlightComputer with up-to-date field values.

Source

pub fn trunc_vel(vel: Vec2D<I32F32>) -> (Vec2D<I32F32>, Vec2D<I64F64>)

Truncates the velocity components to a fixed number of decimal places, as defined by VEL_BE_MAX_DECIMAL, and calculates the remainder (deviation) after truncation.

§Arguments
  • vel: A Vec2D<I32F32> representing the velocity to be truncated.
§Returns

A tuple containing:

  • A Vec2D<I32F32> with truncated velocity components.
  • A Vec2D<I64F64> representing the fractional deviation from the truncation.
Source

pub fn round_vel_expand(vel: Vec2D<I32F32>) -> Vec2D<I32F32>

Rounds velocity by multiplying with 10^Self::VEL_BE_MAX_DECIMAL and rounding afterward

§Arguments
  • vel: A Vec2D<I32F32> representing the velocity to be rounded
§Returns
  • A Vec2D<I32F32> representing the rounded, expanded velocity
Source

pub fn round_vel(vel: Vec2D<I32F32>) -> (Vec2D<I32F32>, Vec2D<I64F64>)

Rounds velocity by multiplying with 10^Self::VEL_BE_MAX_DECIMAL, rounding and dividing back.

§Arguments
  • vel: A Vec2D<I32F32> representing the velocity to be rounded
§Returns
  • A Vec2D<I32F32> representing the rounded velocity
Source

pub fn compute_possible_turns( init_vel: Vec2D<I32F32>, ) -> (Vec<(Vec2D<I32F32>, Vec2D<I32F32>)>, Vec<(Vec2D<I32F32>, Vec2D<I32F32>)>)

Precomputes possible turns of MELVIN, splitting paths into clockwise and counterclockwise directions based on the initial velocity. These precomputed paths are useful for calculating optimal burns.

§Arguments
  • init_vel: A Vec2D<I32F32> representing the initial velocity of the satellite.
§Returns

A tuple of vectors containing possible turns:

  • The first vector contains possible clockwise turns (position, velocity).
  • The second vector contains possible counterclockwise turns (position, velocity).
Source

pub fn current_pos(&self) -> Vec2D<I32F32>

Retrieves the current position of the satellite.

§Returns

A Vec2D representing the current satellite position.

Source

pub fn current_angle(&self) -> CameraAngle

Retrieves the current position of the satellite.

§Returns

A Vec2D representing the current satellite position.

Source

pub fn current_vel(&self) -> Vec2D<I32F32>

Retrieves the current position of the velocity.

§Returns

A Vec2D representing the current satellite velocity.

Source

pub fn max_battery(&self) -> I32F32

Retrieves the maximum battery capacity of the satellite.

This value fluctuates only due to battery depletion safe mode events.

§Returns
  • A I32F32 value representing the maximum battery charge.
Source

pub fn current_battery(&self) -> I32F32

Retrieves the current battery charge level of the satellite.

§Returns
  • A I32F32 value denoting the battery’s current charge level.
Source

pub fn fuel_left(&self) -> I32F32

Retrieves the remaining fuel level of the satellite.

§Returns
  • A I32F32 value representing the remaining percentage of fuel.
Source

pub fn state(&self) -> FlightState

Retrieves the current operational state of the satellite.

The state of the satellite determines its behavior, such as charging (Charge), image acquisition (Acquisition), …

§Returns
  • A FlightState enum denoting the active operational state.
Source

pub fn target_state(&self) -> Option<FlightState>

Retrieves the current target state of the satellite.

The target state represents the resulting state of a commanded State change.

§Returns
  • A Option<FlightState> denoting the target state of the commanded state change.
Source

pub fn client(&self) -> Arc<HTTPClient>

Retrieves a clone of the HTTP client used by the flight computer for sending requests.

§Returns
  • An Arc<http_client::HTTPClient> which represents the HTTP client instance.
Source

pub async fn reset(&mut self)

Sends a reset request to the satellite’s HTTP control system.

This function invokes an HTTP request to reset MELVIN, and it expects the request to succeed.

§Panics
  • If the reset request fails, this method will panic with an error message.
Source

pub fn safe_detected(&mut self)

Indicates that a Supervisor detected a safe mode event

Source

pub async fn wait_for_duration(sleep: Duration, mute: bool)

Waits for a given amount of time with debug prints, this is a static method.

§Arguments
  • sleep: The duration for which the system should wait.
Source

async fn wait_for_condition<F>( self_lock: &RwLock<Self>, __arg1: (F, String), timeout_millis: u32, poll_interval: u16, mute: bool, )
where F: Fn(&Self) -> bool,

Waits for a condition to be met within a specified timeout.

§Arguments
  • self_lock: A RwLock<Self> reference to the active flight computer.
  • condition: A closure that takes a reference to Self and returns a bool.
  • rationale: A string describing the purpose of the wait.
  • timeout_millis: Maximum time in milliseconds to wait for the condition to be met.
  • poll_interval: Interval in milliseconds to check the condition.
§Behavior
  • The method continuously polls the condition at the specified interval until:
    • The condition returns true, or
    • The timeout expires.
  • Logs the rationale and results of the wait.
Source

pub async fn escape_safe(self_lock: Arc<RwLock<Self>>, force_charge: bool)

This method is used to escape a safe mode event by first waiting for the minimum charge and then transitioning back to an operational state.

§Arguments
  • self_lock: A shared RwLock containing the FlightComputer instance
  • force_charge: A variable indicating whether the FlightState after escaping should be forced to FlightState::Charge
Source

pub async fn avoid_transition(self_lock: &Arc<RwLock<Self>>)

A small helper method which waits for the current transition phase to end.

§Arguments
  • self_lock: A shared RwLock containing the FlightComputer instance
Source

pub async fn get_to_comms(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>

A helper method which transitions state-aware to FlightState::Comms.

§Arguments
Source

pub async fn escape_if_comms(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>

A helper method used to get out of FlightState::Comms and back to an operational FlightState.

§Arguments
Source

pub async fn get_to_comms_t_est(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>

A helper method estimating the DateTime<Utc> when a transition to FlightState::Comms could be finished.

§Arguments
Source

pub async fn get_to_static_orbit_vel(self_lock: &Arc<RwLock<Self>>)

A helper method used to perform an acceleration maneuver to get to STATIC_ORBIT_VEL.

§Arguments
Source

async fn get_charge_dt_comms(self_lock: &Arc<RwLock<Self>>) -> u64

A helper method calculating the charge difference for a transition to FlightState::Comms.

§Arguments
§Returns

A u64 resembling the necessary number of charging seconds

Source

pub async fn charge_full_wait(self_lock: &Arc<RwLock<Self>>)

A helper method used to charge to the maximum battery threshold.

§Arguments
Source

pub async fn charge_to_wait(self_lock: &Arc<RwLock<Self>>, target_batt: I32F32)

A helper method used to charge to a given threshold.

§Arguments
  • self_lock: A shared RwLock containing the FlightComputer instance
  • target_batt: An I32F32 resembling the desired target battery level
Source

pub async fn set_state_wait( self_lock: Arc<RwLock<Self>>, new_state: FlightState, )

Transitions the satellite to a new operational state and waits for transition completion.

§Arguments
  • self_lock: A RwLock<Self> reference to the active flight computer.
  • new_state: The target operational state.
Source

pub async fn set_vel_wait( self_lock: Arc<RwLock<Self>>, new_vel: Vec2D<I32F32>, mute: bool, )

Adjusts the velocity of the satellite and waits until the target velocity is reached.

§Arguments
  • self_lock: A RwLock<Self> reference to the active flight computer.
  • new_vel: The target velocity vector.
Source

pub async fn set_angle_wait( self_lock: Arc<RwLock<Self>>, new_angle: CameraAngle, )

Adjusts the satellite’s camera angle and waits until the target angle is reached.

§Arguments
  • self_lock: A RwLock<Self> reference to the active flight computer.
  • new_angle: The target camera angle.
§Behavior
  • If the current angle matches the new angle, logs the status and exits.
  • Checks if the current state permits changing the camera angle. If not, it panics with a fatal error.
  • Sets the new angle and waits until the system confirms it has been applied.
Source

pub async fn execute_burn(self_lock: Arc<RwLock<Self>>, burn: &BurnSequence)

Executes a sequence of thruster burns that affect the trajectory of MELVIN.

§Arguments
  • self_lock: A RwLock<Self> reference to the active flight computer.
  • burn_sequence: A reference to the sequence of executed thruster burns.
Source

pub async fn or_maneuver( self_lock: Arc<RwLock<Self>>, c_o: Arc<RwLock<ClosedOrbit>>, ) -> usize

Executes an orbit return maneuver in a loop until the current position is recognized and assigned an orbit index.

§Arguments
Source

pub fn max_or_maneuver_charge() -> I32F32

Helper method calculating the maximum charge needed for an orbit return maneuver.

§Returns
  • An I32F32, the maximum battery level
Source

fn compute_vmax_and_hold_time(dev: I32F32) -> (I32F32, u64)

Helper method computing the maximum orbit return maneuver velocity, trying either a triangular or trapezoidal profile.

§Arguments
  • dev: The absolute deviation on a singular axis as an I32F32
§Returns

A tuple containing:

  • The maximum velocity change
  • The number of seconds to hold that velocity
Source

pub async fn stop_ongoing_burn(self_lock: Arc<RwLock<Self>>)

A helper method used to stop an ongoing velocity change.

§Arguments
Source

pub async fn turn_for_2nd_target( self_lock: Arc<RwLock<Self>>, target: Vec2D<I32F32>, deadline: DateTime<Utc>, )

Executes a sequence of velocity changes to accelerate towards a secondary target for a multi-target zoned objective.

§Arguments
  • self_lock: A shared RwLock containing the FlightComputer instance
  • target: The target position as a Vec2D<I32F32>
  • deadline: The deadline as a DateTime<Utc>
Source

pub async fn detumble_to( self_lock: Arc<RwLock<Self>>, target: Vec2D<I32F32>, lens: CameraAngle, ) -> (DateTime<Utc>, Vec2D<I32F32>)

Executes a sequence of velocity changes minimizing the deviation between an expected impact point and a target point.

§Arguments
  • self_lock: A shared RwLock containing the FlightComputer instance
  • target: The target position as a Vec2D<I32F32>
  • lens: The planned CameraAngle to derive the maximum absolute speed
§Returns

A tuple containing:

  • A DateTime<Utc> when the target will be hit
  • A Vec2D<I32F32> containing the wrapped target position, if wrapping occured
Source

fn rand_weight() -> I32F32

Random weight to counter numeric local minima

Returns A I32F32 representing a random weight in the range [0.0, 10.0]

Source

pub async fn update_observation(&mut self)

Updates the satellite’s internal fields with the latest observation data.

§Arguments
  • A mutable reference to the FlightComputer instance
Source

async fn set_state(&self, new_state: FlightState)

Sets the satellite’s FlightState.

§Arguments
  • new_state: The new operational state.
Source

async fn set_vel(&self, new_vel: Vec2D<I32F32>, mute: bool)

Sets the satellite’s velocity. The input velocity should only have two decimal places after comma.

§Arguments
  • new_vel: The new velocity.
Source

async fn set_angle(&self, new_angle: CameraAngle)

Sets the satellite’s CameraAngle

§Arguments
  • new_angle: The new Camera Angle.
Source

pub fn pos_in_dt( &self, now: IndexedOrbitPosition, dt: TimeDelta, ) -> IndexedOrbitPosition

Predicts the satellite’s position after a specified time interval.

§Arguments
  • time_delta: The time interval for prediction.
§Returns
  • A Vec2D<I32F32> representing the satellite’s predicted position.
Source

pub fn batt_in_dt(&self, dt: TimeDelta) -> I32F32

Helper method predicting the battery level after a specified time interval.

§Arguments
  • time_delta: The time interval for prediction.
§Returns
  • An I32F32 representing the satellite’s predicted battery level

Trait Implementations§

Source§

impl Debug for FlightComputer

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

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

§

impl<T> MaybeSendSync for T