pub struct GlobalDungeonData<'a>(_, _, _, _);
Expand description

Helper struct for dealing with the current floor, the global dungeon and the mission state.

This is essentially an extension and wrapper of Dungeon that works on the global dungeon struct only.

To generate dungeons and manipulate floors layouts, you can get the game’s builtin generator with Self::get_builtin_dungeon_generator, or configure the global state of the current floor correctly and use Self::generate_floor.

Implementations§

source§

impl<'a> GlobalDungeonData<'a>

source

pub fn is_global_dungeon_ptr_null(_ov29: &OverlayLoadLease<29>) -> bool

Checks if the global dungeon pointer is null.

source

pub unsafe fn get(ov29: &'a OverlayLoadLease<29>) -> Self

Returns a mutable reference to the global dungeon struct wrapped in this struct.

Safety

This is unsafe, since it borrows the global dungeon struct (essentially a static mut) mutably.

You need to make sure no other borrows over the global dungeon struct (or any of it’s values) exist.

source

pub unsafe fn alloc(ov29: &'a OverlayLoadLease<29>) -> Self

This will allocate a new dungeon struct and update the global dungeon pointer to it.

Safety

This is unsafe, since it borrows the global dungeon struct (essentially a static mut) mutably. It also invalidates any previously borrowed global dungeon struct.

You need to make sure no other borrows over the global dungeon struct (or any of it’s values) exist.

source

pub fn effects(&'a mut self) -> &'a mut DungeonEffectsEmitter<'a>

Get the effects handler.

source

pub fn sprites(&'a mut self) -> &'a mut DungeonSpriteHandler<'a>

Get the sprites handler.

source

pub unsafe fn z_init(&mut self)

Zeros out the struct pointed to by the global dungeon pointer.

Safety

This is unsafe, since it updates the global dungeon struct (essentially a static mut).

source

pub unsafe fn free(self)

Frees the dungeons struct pointer to by the master dungeon pointer, and nullifies the pointer.

Safety

This is unsafe, since it completely invalidates borrows of the old global dungeon struct and then invalidates the global dungeon pointer.

source

pub fn inner(&self) -> &Dungeon<&'a mut dungeon>

Returns a reference to the inner dungeon struct.

source

pub fn inner_mut(&mut self) -> &mut Dungeon<&'a mut dungeon>

Returns a mutable reference to the inner dungeon struct.

source

pub fn run_dungeon( &mut self, dungeon_init_data: &mut dungeon_init, dungeon: &mut dungeon ) -> i32

Called at the start of a dungeon. Initializes the dungeon struct from specified dungeon data. Includes a loop that does not break until the dungeon is cleared, and another one inside it that runs until the current floor ends.

source

pub fn get_builtin_dungeon_generator( &'a mut self ) -> GlobalDungeonStructureGenerator<'a>

Returns an abstraction over the game’s builtin dungeon generator. This struct implements dungeon_generator::DungeonFloorGeneration, which is the recommended way to work with it, see the documentation of dungeon_generator.

Note

Note that the builtin dungeon generator works on the global dungeon struct directly.

source

pub fn generate_floor(&'a mut self)

Generates a dungeon floor.

If not changed by a patch, this function will use the game’s default built in generator and generate the floor based on the current global configuration for the floor.

For more granular control over the floor generation, you can get an abstraction over the builtin generator with Self::get_builtin_dungeon_generator.

source

pub fn get_floor_type(&self) -> Option<FloorType>

Gets the floor type. Returns None if the global dungeon struct contains invalid data.

source

pub fn is_substitute_room(&self) -> bool

Checks if the current fixed floor is the “substitute room” (Fixed Room ID 0x6E).

source

pub fn is_current_fixed_room_boss_fight(&self) -> bool

Note: unverified, ported from Irdkwia’s notes

source

pub fn is_full_floor_fixed_room(&self) -> bool

Checks if the current fixed room on the dungeon generation info corresponds to a fixed, full-floor layout.

The first non-full-floor fixed room is 0xA5, which is for Sealed Chambers.

source

pub fn is_even_floor(&self) -> bool

Checks if the current dungeon floor number is even. This is probably, among other things(?), used to determine whether male or female monsters should be spawned. Has a special check to return false for Labyrinth Cave B10F (the Gabite boss fight).

source

pub fn get_tile(&self, x: i32, y: i32) -> &DungeonTile

Returns the tile at the given coordinates.

If the coordinates are out-of-bounds, this seems to return a copy of a default tile.

source

pub fn get_tile_mut(&mut self, x: i32, y: i32) -> &mut DungeonTile

Returns the tile at the given coordinates.

If the coordinates are out-of-bounds, this seems to return a copy of a default tile.

source

pub fn is_gravity_active(&self) -> bool

Checks if gravity is active on the floor.

source

pub fn is_secret_floor(&self) -> bool

Checks if the current floor is a secret bazaar or a secret room.

source

pub fn is_secret_bazaar(&self) -> bool

Checks if the current floor is the Secret Bazaar.

source

pub fn is_secret_room(&self) -> bool

Checks if the current floor is the Secret Room fixed floor (from hidden stairs).

source

pub fn is_normal_floor(&self) -> bool

Checks if the current floor is a normal layout.

“Normal” means any layout that is NOT one of the following:

  • Hidden stairs floors
  • Golden Chamber
  • Challenge Request floor
  • Outlaw hideout
  • Treasure Memo floor
  • Full-room fixed floors (ID < 0xA5) [0xA5 == Sealed Chamber]
source

pub fn should_boost_hidden_stairs_spawn_chance(&self) -> bool

Gets the boost_hidden_stairs_spawn_chance field on the dungeon struct.

source

pub fn set_should_boost_hidden_stairs_spawn_chance(&mut self, value: bool)

Sets the boost_hidden_stairs_spawn_chance field on the dungeon struct to the given value.

source

pub fn clear_hidden_stairs(&mut self)

Clears the tile (terrain and spawns) on which Hidden Stairs are spawned, if applicable.

source

pub fn is_pos_out_of_bounds(&self, x: i32, y: i32) -> bool

Checks if a position (x, y) is out of bounds on the map: !((0 <= x <= 55) && (0 <= y <= 31)).

source

pub fn is_hidden_stairs_floor(&self) -> bool

Checks if the current floor is either the Secret Bazaar or a Secret Room.

source

pub fn is_outlaw_or_challenge_request_floor(&self) -> bool

Checks if the current floor is an active mission destination of type MissionType::TakeItemFromOutlaw, MissionType::ArrestOutlaw or MissionType::ChallengeRequest.

source

pub fn is_destination_floor(&self) -> bool

Checks if the current floor is a mission destination floor.

source

pub fn is_current_mission_type( &self, mission_type_group: MissionTypeGroup ) -> bool

Checks if the current floor is an active mission destination of a given type group.

source

pub fn is_current_mission_type_exact(&self, mission_type: MissionType) -> bool

Checks if the current floor is an active mission destination of a given type.

source

pub fn is_outlaw_monster_house_floor(&self) -> bool

Checks if the current floor is a mission destination for a Monster House outlaw mission.

source

pub fn is_golden_chamber(&self) -> bool

Checks if the current floor is a Golden Chamber floor.

source

pub fn is_legendary_challenge_floor(&self) -> bool

Checks if the current floor is a boss floor for a Legendary Challenge Letter mission.

source

pub fn is_jirachi_challenge_floor(&self) -> bool

Checks if the current floor is the boss floor in Star Cave Pit for Jirachi’s Challenge Letter mission.

source

pub fn is_destination_floor_with_monster(&self) -> bool

Checks if the current floor is a mission destination floor with a special monster.

See Self::floor_has_mission_monster for details.

source

pub fn get_stairs_room(&self) -> u8

Returns the index of the room that contains the stairs.

source

pub fn floor_has_mission_monster(&self) -> bool

Checks if a given floor is a mission destination with a special monster, either a target to rescue or an enemy to defeat.

Mission types with a monster on the destination floor:

  • Rescue client
  • Rescue target
  • Escort to target
  • Deliver item
  • Search for target
  • Take item from outlaw
  • Arrest outlaw
  • Challenge Request
source

pub fn floor_has_mission_monster_static( mission_destination: &mission_destination_info, _ov29: &OverlayLoadLease<29> ) -> bool

Static version of Self::floor_has_mission_monster. See it for details.

source

pub fn is_mission_target_enemy_defeated(&self) -> bool

Checks if the target enemy of the mission on the current floor has been defeated.

source

pub fn set_mission_target_enemy_defeated(&mut self, flag: bool)

Set the flag for whether or not the target enemy of the current mission has been defeated.

source

pub fn is_destination_floor_with_fixed_room(&self) -> bool

Checks if the current floor is a mission destination floor with a fixed room.

The entire floor can be a fixed room layout, or it can just contain a Sealed Chamber.

source

pub fn get_item_to_retrieve(&self) -> ItemId

Get the ID of the item that needs to be retrieve on the current floor for a mission, if one exists.

source

pub fn get_item_to_deliver(&self) -> ItemId

Get the ID of the item that needs to be delivered to a mission client on the current floor, if one exists.

source

pub fn get_special_target_item(&self) -> ItemId

Get the ID of the special target item for a Sealed Chamber or Treasure Memo mission on the current floor.

source

pub fn is_destination_floor_with_item(&self) -> bool

Checks if the current floor is a mission destination floor with a special item.

This excludes missions involving taking an item from an outlaw.

source

pub fn is_destination_floor_with_hidden_outlaw(&self) -> bool

Checks if the current floor is a mission destination floor with a “hidden outlaw” that behaves like a normal enemy.

source

pub fn is_destination_floor_with_fleeing_outlaw(&self) -> bool

Checks if the current floor is a mission destination floor with a “fleeing outlaw” that runs away.

source

pub fn get_mission_target_enemy(&self) -> MonsterSpeciesId

Get the monster ID of the target enemy to be defeated on the current floor for a mission, if one exists.

source

pub fn get_mission_enemy_minion_group( &self, minion_group_index: i32 ) -> MonsterSpeciesId

Get the monster ID of the specified minion group on the current floor for a mission, if it exists.

Note that a single minion group can correspond to multiple actual minions of the same species. There can be up to 2 minion groups.

source

pub fn get_target_monster_not_found_flag(&self) -> bool

source

pub fn set_target_monster_not_found_flag(&mut self, value: bool)

Sets ffi::dungeon::target_monster_not_found_flag to the specified value.

source

pub fn get_leader(&mut self) -> Option<&DungeonEntity>

Gets a reference to the entity that is currently leading the team, or None if none of the first 4 entities is a valid monster with its is_team_leader flag set.

source

pub fn get_leader_mut(&mut self) -> Option<&mut DungeonEntity>

Gets a mutable reference to the entity that is currently leading the team, or None if none of the first 4 entities is a valid monster with its is_team_leader flag set.

source

pub fn story_restrictions_enabled(&self) -> bool

Returns true if certain special restrictions are enabled.

If true, you will get kicked out of the dungeon if a team member that passes the DungeonId::is_special_joined_at_location2 check faints.

Returns !ffi::dungeon::nonstory_flag || ffi::dungeon::hidden_land_flag

source

pub fn is_on_monster_spawn_list(&self, monster_id: MonsterSpeciesId) -> bool

Returns true if the specified monster is included in the floor’s monster spawn list (the modified list after a maximum of 14 different species were chosen).

source

pub unsafe fn load_fixed_room_data(&mut self)

Loads fixed room data from BALANCE/fixed.bin into the buffer pointed to by FIXED_ROOM_DATA_PTR (see symbol table).

Safety

This modifies a global buffer. FIXED_ROOM_DATA_PTR needs to be valid, no references to it’s content must exist.

source

pub unsafe fn load_fixed_room( &mut self, param_1: i32, param_2: i32, param_3: i32, param_4: undefined4 ) -> i32

Loads fixed room data from BALANCE/fixed.bin into the buffer pointed to by FIXED_ROOM_DATA_PTR (see symbol table).

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn set_forced_loss_reason(&mut self, reason: ForcedLossReason)

Sets the forced loss reason to a given value.

source

pub fn get_forced_loss_reason(&self) -> Option<ForcedLossReason>

Gets the forced loss reason, returns None if it’s invalid.

source

pub fn change_leader(&mut self)

Tries to change the current leader to the monster specified by ffi::dungeon::new_leader. Accounts for situations that can prevent changing leaders, such as having stolen from a Kecleon shop. If one of those situations prevents changing leaders, prints the corresponding message to the message log.

source

pub fn handle_faint( &mut self, fainted_entity: &mut DungeonEntity, faint_reason: faint_reason, killer: &mut DungeonEntity )

Handles a fainted monster (reviving does not count as fainting).

Arguments
  • fainted_entity: Fainted entity
  • faint_reason: Faint reason (move ID or greater than the max move id for other causes)
  • killer: Entity responsible of the fainting
source

pub fn get_minimap_data(&self) -> Option<&minimap_display_data>

Returns a reference to the minimap_display_data struct in the dungeon struct, if it exists.

source

pub fn get_minimap_data_mut(&mut self) -> Option<&mut minimap_display_data>

Returns a mutable reference to the minimap_display_data struct in the dungeon struct, if it exists.

source

pub fn set_minimap_data_e447(&mut self, value: u8)

Sets ffi::minimap_display_data::field_0xE447 to the specified value

source

pub fn get_minimap_data_e447(&mut self) -> u8

source

pub fn set_minimap_data_e448(&mut self, value: u8)

Sets ffi::minimap_display_data::field_0xE448 to the specified value

source

pub unsafe fn open_message_log( &mut self, param_1: undefined4, param_2: undefined4 )

Opens the message log window.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn display_dungeon_tip(&mut self, tip: &mut message_tip, log: bool)

Checks if a given dungeon tip was not displayed yet and if so, displays it.

If log is true, the tip will also be written to the message log.

source

pub unsafe fn display_message( &mut self, param_1: undefined4, message_id: i32, wait_for_input: bool )

Displays a message in a dialogue box that optionally waits for player input before closing.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub unsafe fn display_message2( &mut self, param_1: undefined4, message_id: i32, wait_for_input: bool )

Displays a message in a dialogue box that optionally waits for player input before closing.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn try_forced_loss(&mut self, skip_floor_end_check: bool) -> bool

Attempts to trigger a forced loss of the type set with Self::set_forced_loss_reason.

Returns whether the forced loss happens or not.

The flag controls, if the function will not check for the end of the floor condition and will skip other (unknown) actions in case of forced loss.

source

pub fn update_map_surveyor_flag(&mut self) -> bool

Sets the Map Surveyor flag in the dungeon struct to true if a team member has Map Surveyor, sets it to false otherwise.

This function has two variants: in the EU ROM, it will return true if the flag was changed. The NA version will return the new value of the flag instead.

source

pub fn get_monster_id_to_spawn( &mut self, is_for_monster_house: bool ) -> MonsterSpeciesId

Get the id of the monster to be randomly spawned.

source

pub fn get_monster_level_to_spawn(&mut self, monster_id: MonsterSpeciesId) -> u8

Get the level of the monster to be spawned, given its id.

Returns the level of the monster to be spawned, or 1 if the specified ID can’t be found on the floor’s spawn table.

source

pub fn tick_status_turn_counter(&mut self, counter: &mut u8) -> u8

Ticks down a turn counter for a status condition. If the counter equals 0x7F, it will not be decreased.

Returns the new counter value.

source

pub fn run_fractional_turn(&mut self, is_first_loop: bool)

The main function which executes the actions that take place in a fractional turn.

Called in a loop by Self::run_dungeon while Self::is_floor_over returns false.

The flag should set to true when the function is first called during a floor.

source

pub unsafe fn run_leader_turn(&mut self, param_1: undefined) -> bool

Handles the leader’s turn. Includes a movement speed check that might cause it to return early if the leader isn’t fast enough to act in this fractional turn. If that check (and some others) pass, the function does not return until the leader performs an action.

Returns true, if the leader has performed an action.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn set_leader_action(&mut self)

Sets the leader’s action field depending on the inputs given by the player.

This function also accounts for other special situations that can force a certain action, such as when the leader is running. The function also takes care of opening the main menu when X is pressed.

The function generally doesn’t return until the player has an action set.

source

pub fn try_spawn_monster_and_activate_plus_minus(&mut self)

Called at the beginning of Self::run_fractional_turn. Executed only if FRACTIONAL_TURN_SEQUENCE[fractional_turn * 2] is not 0. First it calls Self::try_spawn_monster_and_tick_spawn_counter, then tries to activate the Plus and Minus abilities for both allies and enemies, and finally calls Self::try_forced_loss.

source

pub fn is_floor_over(&self) -> bool

source

pub fn decrement_wind_counter(&self)

Decrements ffi::dungeon::wind_turns and displays a wind warning message if required.

source

pub fn get_kecleon_id_to_spawn_by_floor(&self) -> MonsterSpeciesId

If the current floor number is even, returns female Kecleon’s id (default: 0x3D7), otherwise returns male Kecleon’s id (default: 0x17F).

source

pub fn mew_spawn_check( &self, monster_id: MonsterSpeciesId, force_fail_if_mew: bool ) -> bool

If the monster id parameter is 0x97 (Mew), returns false if either ffi::dungeon::mew_cannot_spawn or the second parameter are true.

Called before spawning an enemy, appears to be checking if Mew can spawn on the current floor.

source

pub fn get_random_spawn_monster_id(&self) -> MonsterSpeciesId

Note: unverified, ported from Irdkwia’s notes

source

pub fn get_team_member_with_iq_skill( &self, iq_skill: IqSkillId ) -> Option<&DungeonEntity>

Returns an entity reference to the first team member which has the specified iq skill.

source

pub fn get_team_member_with_iq_skill_mut( &mut self, iq_skill: IqSkillId ) -> Option<&mut DungeonEntity>

Returns an entity reference to the first team member which has the specified iq skill.

source

pub fn team_member_has_enabled_iq_skill(&self, iq_skill: IqSkillId) -> bool

Returns true if any team member has the specified iq skill.

source

pub fn team_leader_has_enabled_iq_skill(&self, iq_skill: IqSkillId) -> bool

Returns true the leader has the specified iq skill.

source

pub unsafe fn init_team(&mut self, param_1: undefined)

Initializes the team when entering a dungeon.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub unsafe fn init_team_member( &mut self, arg1: MonsterSpeciesId, x_pos: i16, y_pos: i16, team_member_data: &mut team_member, param_5: undefined, param_6: undefined, param_7: undefined, param_8: undefined, param_9: undefined )

Initializes a team member. Run at the start of each floor in a dungeon.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn generate_mission_egg_monster(&mut self, mission: &mut mission)

Generates the monster ID in the egg from the given mission. Uses the base form of the monster.

Note: unverified, ported from Irdkwia’s notes

source

pub fn spawn_monster( &mut self, spawn_data: &mut spawned_monster_data, force_awake: bool ) -> Option<&mut DungeonEntity>

Spawns the given monster on a tile. Returns None, if the game returned a null-pointer after the spawn.

source

pub fn spawn_enemy_trap_bound( &mut self, trap_id: TrapId, x_position: i16, y_position: i16, flags: u8, is_visible: bool )

A convenience wrapper around Self::spawn_trap and DungeonTile::bind_trap (or to be precise the game’s functions, see implementation!).

Always passes 0 for the team parameter (making it an enemy trap).

source

pub fn spawn_trap( &mut self, trap_id: TrapId, position: &position, team: u8, flags: u8 ) -> Option<&mut DungeonEntity>

Spawns a trap on the floor. Fails if there are more than 64 traps already on the floor.

This modifies the appropriate fields on the dungeon struct, initializing new entries in the entity table and the trap info list.

source

pub fn spawn_item( &'a mut self, position: &position, item: &'a mut Item, flag: bool ) -> bool

Spawns an item on the floor. Fails if there are more than 64 items already on the floor.

This calls Self::spawn_item_entity, fills in the item info struct, sets the entity to be visible, binds the entity to the tile it occupies, updates the n_items counter on the dungeon struct, and various other bits of bookkeeping.

Hint: Consider using Self::generate_and_spawn_item instead for ease of use.

source

pub fn generate_and_spawn_item( &mut self, item_id: ItemId, x: i16, y: i16, quantity: u16, sticky: bool, check_in_bag: bool )

Generates an item with Item::generate_explicit, then spawns it with Self::spawn_item.

If the check-in-bag flag is set and the player’s bag already contains an item with the given ID, a Reviver Seed will be spawned instead.

It seems like this function is only ever called in one place, with an item ID of 0x49 (Reviver Seed).

source

pub fn spawn_item_entity( &mut self, position: &position ) -> Option<&mut DungeonEntity>

Spawns a blank item entity on the floor. Fails if there are more than 64 items already on the floor.

This initializes a new entry in the entity table and points it to the corresponding slot in the item info list.

source

pub unsafe fn spawn_enemy_item_drop( &mut self, entity: &mut DungeonEntity, item_entity: &mut DungeonEntity, item: &mut Item, param_4: i32, dir_xy: &mut i16, param_6: undefined )

Appears to spawn an enemy item drop at a specified location, with a log message.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub unsafe fn spawn_enemy_item_drop_wrapper( &mut self, entity: &mut DungeonEntity, pos: &mut position, item: &mut Item, param_4: undefined4 )

Wraps Self::spawn_enemy_item_drop in a more convenient interface.

Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn try_generate_unown_drop(monster_id: MonsterSpeciesId) -> Option<Item>

Determine if a defeated monster should drop a Unown Stone, and generate the item if so.

Checks that the current dungeon isn’t a Marowak Dojo training maze, and that the monster is an Unown. If so, there’s a 21% chance that an Unown Stone will be generated.

source

pub fn try_activate_slow_start(&mut self)

Runs a check over all monsters on the field for the ability Slow Start, and lowers the speed of those who have it.

source

pub fn try_activate_artificial_weather_abilities(&mut self)

Runs a check over all monsters on the field for abilities that affect the weather and changes the floor’s weather accordingly.

source

pub fn try_spawn_monster_and_tick_spawn_counter(&mut self)

First ticks up the spawn counter, and if it’s equal or greater than the spawn cooldown, it will try to spawn an enemy if the number of enemies is below the spawn cap.

If the spawn counter is greater than 900, it will instead perform the special spawn caused by the ability Illuminate.

source

pub fn get_dungeon_gen_info_unk_0c(&self) -> undefined4

Returns ffi::dungeon_generation_info::field_0xc for the global dungeon struct.

source

pub fn check_team_member_index(&self, team_member: &team_member) -> bool

Checks if a value obtained from ffi::team_member::member_index is equal to certain values.

This is known to return true for some or all of the guest monsters (if the value is equal to 0x55AA or 0x5AA5).

Note

The underlying function ffi::CheckTeamMemberField8 does not need overlay29 to be loaded.

source

pub fn check_team_items_flag(&self, flags: i32) -> bool

Checks whether any of the items in the bag or any of the items carried by team members has any of the specified flags set in its flags field:

(0 = f_exists, 1 = f_in_shop, 2 = f_unpaid, etc.)

Returns true if any of the items of the team has the specified flags set, false otherwise.

source

pub fn check_active_challenge_request(&self) -> bool

Checks if there’s an active challenge request on the current dungeon.

source

pub fn is_marowak_training_maze(&self) -> bool

Check if the current dungeon is one of the training mazes in Marowak Dojo (this excludes Final Maze).

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for GlobalDungeonData<'a>

§

impl<'a> !Send for GlobalDungeonData<'a>

§

impl<'a> !Sync for GlobalDungeonData<'a>

§

impl<'a> Unpin for GlobalDungeonData<'a>

§

impl<'a> !UnwindSafe for GlobalDungeonData<'a>

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

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

Casts the value.
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere 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 Dstwhere Src: CheckedCast<Dst>,

source§

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

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere 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 Dstwhere Src: OverflowingCast<Dst>,

source§

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

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

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

Casts the value.
source§

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

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

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

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

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

Casts the value.
source§

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

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.