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: FlightStateCurrent state of the satellite based on FlightState.
target_state: Option<FlightState>Target State if current_state is FlightState::Transition
current_angle: CameraAngleCurrent angle of the satellite’s camera (e.g., Narrow, Normal, Wide).
current_battery: I32F32Current battery level of the satellite.
max_battery: I32F32Maximum battery capacity of the satellite.
fuel_left: I32F32Remaining 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
impl FlightComputer
Sourcepub const MIN_0: I32F32 = I32F32::ZERO
pub const MIN_0: I32F32 = I32F32::ZERO
A constant I32F32 0.0 value for fuel and battery min values
Sourcepub const FUEL_CONST: I32F32
pub const FUEL_CONST: I32F32
Constant fuel consumption per accelerating second
Sourcepub const VEL_BE_MAX_DECIMAL: u8 = 2u8
pub const VEL_BE_MAX_DECIMAL: u8 = 2u8
Maximum decimal places that are used in the observation endpoint for velocity
Sourceconst DEF_COND_TO: u32 = 3_000u32
const DEF_COND_TO: u32 = 3_000u32
Constant timeout for the wait_for_condition-method
Sourceconst DEF_COND_PI: u16 = 500u16
const DEF_COND_PI: u16 = 500u16
Constant timeout for the wait_for_condition-method
Sourceconst TO_SAFE_SLEEP: Duration
const TO_SAFE_SLEEP: Duration
Constant transition to SAFE sleep time for all states
Sourceconst MAX_OR_VEL_CHANGE_ABS: I32F32
const MAX_OR_VEL_CHANGE_ABS: I32F32
Maximum absolute vel change for orbit return
Sourceconst MAX_OR_VEL_CHANGE_DEV: I32F32
const MAX_OR_VEL_CHANGE_DEV: I32F32
Deviation at which MAX_VEL_CHANGE_ABS should occur
Sourceconst MAX_OR_ACQ_ACC_TIME: I32F32
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)
Sourceconst MAX_OR_ACQ_TIME: I32F32
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)
Sourceconst AFTER_SAFE_MIN_BATT: I32F32
const AFTER_SAFE_MIN_BATT: I32F32
Minimum battery used in decision-making for after safe transition
Sourceconst EXIT_SAFE_MIN_BATT: I32F32
const EXIT_SAFE_MIN_BATT: I32F32
Minimum battery needed to exit safe mode
Sourceconst DEF_BRAKE_ABS: I32F32
const DEF_BRAKE_ABS: I32F32
Maximum absolute break velocity change
Sourceconst MAX_DETUMBLE_DT: TimeDelta
const MAX_DETUMBLE_DT: TimeDelta
Maximum burn time for detumbling
Sourceconst LEGAL_TARGET_STATES: [FlightState; 3]
const LEGAL_TARGET_STATES: [FlightState; 3]
Legal Target States for State Change
Sourcepub fn one_time_safe(&mut self)
pub fn one_time_safe(&mut self)
Debug method used to emulate a safe mode event
Sourcepub async fn new(request_client: Arc<HTTPClient>) -> FlightComputer
pub async fn new(request_client: Arc<HTTPClient>) -> FlightComputer
Sourcepub fn trunc_vel(vel: Vec2D<I32F32>) -> (Vec2D<I32F32>, Vec2D<I64F64>)
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: AVec2D<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.
Sourcepub fn compute_possible_turns(
init_vel: Vec2D<I32F32>,
) -> (Vec<(Vec2D<I32F32>, Vec2D<I32F32>)>, Vec<(Vec2D<I32F32>, Vec2D<I32F32>)>)
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: AVec2D<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).
Sourcepub fn current_pos(&self) -> Vec2D<I32F32>
pub fn current_pos(&self) -> Vec2D<I32F32>
Retrieves the current position of the satellite.
§Returns
A Vec2D representing the current satellite position.
Sourcepub fn current_angle(&self) -> CameraAngle
pub fn current_angle(&self) -> CameraAngle
Retrieves the current position of the satellite.
§Returns
A Vec2D representing the current satellite position.
Sourcepub fn current_vel(&self) -> Vec2D<I32F32>
pub fn current_vel(&self) -> Vec2D<I32F32>
Retrieves the current position of the velocity.
§Returns
A Vec2D representing the current satellite velocity.
Sourcepub fn max_battery(&self) -> I32F32
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
I32F32value representing the maximum battery charge.
Sourcepub fn current_battery(&self) -> I32F32
pub fn current_battery(&self) -> I32F32
Retrieves the current battery charge level of the satellite.
§Returns
- A
I32F32value denoting the battery’s current charge level.
Sourcepub fn fuel_left(&self) -> I32F32
pub fn fuel_left(&self) -> I32F32
Retrieves the remaining fuel level of the satellite.
§Returns
- A
I32F32value representing the remaining percentage of fuel.
Sourcepub fn state(&self) -> FlightState
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
FlightStateenum denoting the active operational state.
Sourcepub fn target_state(&self) -> Option<FlightState>
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.
Sourcepub fn client(&self) -> Arc<HTTPClient>
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.
Sourcepub async fn reset(&mut self)
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.
Sourcepub fn safe_detected(&mut self)
pub fn safe_detected(&mut self)
Indicates that a Supervisor detected a safe mode event
Sourcepub async fn wait_for_duration(sleep: Duration, mute: bool)
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.
Sourceasync fn wait_for_condition<F>(
self_lock: &RwLock<Self>,
__arg1: (F, String),
timeout_millis: u32,
poll_interval: u16,
mute: bool,
)
async fn wait_for_condition<F>( self_lock: &RwLock<Self>, __arg1: (F, String), timeout_millis: u32, poll_interval: u16, mute: bool, )
Waits for a condition to be met within a specified timeout.
§Arguments
self_lock: ARwLock<Self>reference to the active flight computer.condition: A closure that takes a reference toSelfand returns abool.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.
- The condition returns
- Logs the rationale and results of the wait.
Sourcepub async fn escape_safe(self_lock: Arc<RwLock<Self>>, force_charge: bool)
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 sharedRwLockcontaining theFlightComputerinstanceforce_charge: A variable indicating whether theFlightStateafter escaping should be forced toFlightState::Charge
Sourcepub async fn avoid_transition(self_lock: &Arc<RwLock<Self>>)
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 sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn get_to_comms(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>
pub async fn get_to_comms(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>
A helper method which transitions state-aware to FlightState::Comms.
§Arguments
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn escape_if_comms(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>
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
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn get_to_comms_t_est(self_lock: Arc<RwLock<Self>>) -> DateTime<Utc>
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
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn get_to_static_orbit_vel(self_lock: &Arc<RwLock<Self>>)
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
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourceasync fn get_charge_dt_comms(self_lock: &Arc<RwLock<Self>>) -> u64
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
self_lock: A sharedRwLockcontaining theFlightComputerinstance
§Returns
A u64 resembling the necessary number of charging seconds
Sourcepub async fn charge_full_wait(self_lock: &Arc<RwLock<Self>>)
pub async fn charge_full_wait(self_lock: &Arc<RwLock<Self>>)
A helper method used to charge to the maximum battery threshold.
§Arguments
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn charge_to_wait(self_lock: &Arc<RwLock<Self>>, target_batt: I32F32)
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 sharedRwLockcontaining theFlightComputerinstancetarget_batt: AnI32F32resembling the desired target battery level
Sourcepub async fn set_state_wait(
self_lock: Arc<RwLock<Self>>,
new_state: FlightState,
)
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: ARwLock<Self>reference to the active flight computer.new_state: The target operational state.
Sourcepub async fn set_vel_wait(
self_lock: Arc<RwLock<Self>>,
new_vel: Vec2D<I32F32>,
mute: bool,
)
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: ARwLock<Self>reference to the active flight computer.new_vel: The target velocity vector.
Sourcepub async fn set_angle_wait(
self_lock: Arc<RwLock<Self>>,
new_angle: CameraAngle,
)
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: ARwLock<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.
Sourcepub async fn execute_burn(self_lock: Arc<RwLock<Self>>, burn: &BurnSequence)
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: ARwLock<Self>reference to the active flight computer.burn_sequence: A reference to the sequence of executed thruster burns.
Sourcepub async fn or_maneuver(
self_lock: Arc<RwLock<Self>>,
c_o: Arc<RwLock<ClosedOrbit>>,
) -> usize
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
self_lock: A sharedRwLockcontaining theFlightComputerinstancec_o: A sharedRwLockcontaining theClosedOrbitinstance
Sourcepub fn max_or_maneuver_charge() -> I32F32
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
Sourcefn compute_vmax_and_hold_time(dev: I32F32) -> (I32F32, u64)
fn compute_vmax_and_hold_time(dev: I32F32) -> (I32F32, u64)
Sourcepub async fn stop_ongoing_burn(self_lock: Arc<RwLock<Self>>)
pub async fn stop_ongoing_burn(self_lock: Arc<RwLock<Self>>)
A helper method used to stop an ongoing velocity change.
§Arguments
self_lock: A sharedRwLockcontaining theFlightComputerinstance
Sourcepub async fn turn_for_2nd_target(
self_lock: Arc<RwLock<Self>>,
target: Vec2D<I32F32>,
deadline: DateTime<Utc>,
)
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 sharedRwLockcontaining theFlightComputerinstancetarget: The target position as aVec2D<I32F32>deadline: The deadline as aDateTime<Utc>
Sourcepub async fn detumble_to(
self_lock: Arc<RwLock<Self>>,
target: Vec2D<I32F32>,
lens: CameraAngle,
) -> (DateTime<Utc>, Vec2D<I32F32>)
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 sharedRwLockcontaining theFlightComputerinstancetarget: The target position as aVec2D<I32F32>lens: The plannedCameraAngleto 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
Sourcefn rand_weight() -> I32F32
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]
Sourcepub async fn update_observation(&mut self)
pub async fn update_observation(&mut self)
Updates the satellite’s internal fields with the latest observation data.
§Arguments
- A mutable reference to the
FlightComputerinstance
Sourceasync fn set_state(&self, new_state: FlightState)
async fn set_state(&self, new_state: FlightState)
Sourceasync fn set_vel(&self, new_vel: Vec2D<I32F32>, mute: bool)
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.
Sourceasync fn set_angle(&self, new_angle: CameraAngle)
async fn set_angle(&self, new_angle: CameraAngle)
Sourcepub fn pos_in_dt(
&self,
now: IndexedOrbitPosition,
dt: TimeDelta,
) -> IndexedOrbitPosition
pub fn pos_in_dt( &self, now: IndexedOrbitPosition, dt: TimeDelta, ) -> IndexedOrbitPosition
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlightComputer
impl !RefUnwindSafe for FlightComputer
impl Send for FlightComputer
impl Sync for FlightComputer
impl Unpin for FlightComputer
impl !UnwindSafe for FlightComputer
Blanket Implementations§
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
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) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
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
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.