### Get Item Install Information Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Retrieves installation information for a workshop item, such as the installation folder path. Returns `None` if the item is not installed. ```rust pub fn item_install_info(&self, item: PublishedFileId) -> Option ``` -------------------------------- ### item_install_info Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Retrieves installation information for a specific workshop item. ```APIDOC ## item_install_info ### Description Gets installation information for a workshop item. ### Method `&self` ### Parameters * **item** (PublishedFileId) - Required - The ID of the item to get installation information for. ### Returns * **Option** - An optional struct containing installation details. ``` -------------------------------- ### Get App Install Directory Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Returns the installation folder for the app with the given ID. This function works even if the app is not installed, indicating its default installation location. ```rust pub fn app_install_dir(&self, app_id: AppId) -> String ``` -------------------------------- ### app_install_dir Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Gets the installation directory for the specified app ID. This works even if the app is not installed. ```APIDOC ## app_install_dir ### Description Returns the installation folder of the app with the given ID. This works even if the app isn’t installed, returning where it would be installed in the default location. ### Method `&self` ### Parameters * **app_id** (AppId) - Description: The ID of the app. ### Returns * **String** - The installation directory of the app. ``` -------------------------------- ### Rust match_indices Examples Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Illustrates finding the starting indices and the matched substrings for all non-overlapping occurrences of a pattern within a string using `match_indices`. Overlapping matches are handled by returning only the first. ```rust let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect(); assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]); ``` ```rust let v: Vec<_> = "1abcabc2".match_indices("abc").collect(); assert_eq!(v, [(1, "abc"), (4, "abc")]); ``` ```rust let v: Vec<_> = "ababa".match_indices("aba").collect(); assert_eq!(v, [(0, "aba")]); // only the first `aba` ``` -------------------------------- ### start_item_update Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Starts the process of updating an existing workshop item. ```APIDOC ## start_item_update ### Description Starts an item update process. ### Method `&self` ### Parameters * **app_id** (AppId) - Required - The ID of the application. * **file_id** (PublishedFileId) - Required - The ID of the file to update. ### Returns * **UpdateHandle** - A handle to the update process. ``` -------------------------------- ### Finish Method for SteamworksPlugin Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.SteamworksPlugin.html Completes the plugin's setup after all other registered plugins are ready. Useful for plugins that depend on the asynchronous setup of other plugins. ```rust fn finish(&self, _app: &mut App) ``` -------------------------------- ### Check if App is Installed Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Verifies if the user has the app with the specified ID installed. This check does not confirm ownership. ```rust pub fn is_app_installed(&self, app_id: AppId) -> bool ``` -------------------------------- ### Get Item State Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Returns the current state of a specific workshop item, such as whether it is downloaded or installed. ```rust pub fn item_state(&self, item: PublishedFileId) -> ItemState ``` -------------------------------- ### InstallInfo Struct Definition Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.InstallInfo.html Defines the structure for storing installation information, including the folder path, size on disk, and a timestamp. ```rust pub struct InstallInfo { pub folder: String, pub size_on_disk: u64, pub timestamp: u32, } ``` -------------------------------- ### Ready Method for SteamworksPlugin Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.SteamworksPlugin.html Checks if the plugin has finished its setup. This is useful for plugins with asynchronous initialization steps. ```rust fn ready(&self, _app: &App) -> bool ``` -------------------------------- ### Splitting and Substring Range Example Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Demonstrates splitting a string by a delimiter and obtaining substring ranges. This is an experimental feature. ```rust #![feature(substr_range)] let data = "a, b, b, a"; let mut iter = data.split(", ").map(|s| data.substr_range(s).unwrap()); assert_eq!(iter.next(), Some(0..1)); assert_eq!(iter.next(), Some(3..4)); assert_eq!(iter.next(), Some(6..7)); assert_eq!(iter.next(), Some(9..10)); ``` -------------------------------- ### Swap remove example Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Demonstrates the `swap_remove` method for efficiently removing elements from a vector without preserving order. ```rust let mut v = vec!["foo", "bar", "baz", "qux"]; assert_eq!(v.swap_remove(1), "bar"); assert_eq!(v, ["foo", "qux", "baz"]); assert_eq!(v.swap_remove(0), "foo"); assert_eq!(v, ["baz", "qux"]); ``` -------------------------------- ### Get Available Game Languages Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Returns a list of all languages supported by the current app. ```rust pub fn available_game_languages(&self) -> Vec ``` -------------------------------- ### Iterating over Ok Result Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.SResult.html Example showing how to collect the value from an Ok Result into a vector. ```rust let x: Result = Ok(5); let v: Vec = x.into_iter().collect(); assert_eq!(v, [5]); ``` -------------------------------- ### Checking for String Prefix Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Shows how to use `starts_with()` to verify if a string begins with a specific pattern. ```rust let bananas = "bananas"; assert!(bananas.starts_with("bana")); assert!(!bananas.starts_with("nana")); ``` ```rust let bananas = "bananas"; // Note that both of these assert successfully. assert!(bananas.starts_with(&['b', 'a', 'n', 'a'])); assert!(bananas.starts_with(&['a', 'b', 'c', 'd'])); ``` -------------------------------- ### Setting Global Authentication Status Callback Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/enum.NetworkingConfigValue.html Demonstrates how to set a global callback for authentication status changes. It's recommended to install this callback before creating any connections or listen sockets. ```cpp ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged ``` -------------------------------- ### Configuring P2P STUN Server List Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/enum.NetworkingConfigValue.html Example of setting a comma-separated list of STUN servers for NAT piercing. An empty string disables NAT piercing attempts. ```cpp [connection string] Comma-separated list of STUN servers that can be used for NAT piercing. If you set this to an empty string, NAT piercing will not be attempted. Also if “public” candidates are not allowed for P2P_Transport_ICE_Enable, then this is ignored. ``` -------------------------------- ### Check if DLC is Installed Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Determines if the user owns and has the specified DLC installed. ```rust pub fn is_dlc_installed(&self, app_id: AppId) -> bool ``` -------------------------------- ### Start an Item Update Process Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Begins the process of updating an existing workshop item. Returns an `UpdateHandle` that can be used to manage the update. ```rust pub fn start_item_update( &self, app_id: AppId, file_id: PublishedFileId, ) -> UpdateHandle ``` -------------------------------- ### Get Co-play Timestamp Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Gets the timestamp of when the user last played with someone on their recently-played-with list. ```rust pub fn coplay_time(&self) -> i32 ``` -------------------------------- ### Collecting Results with checked_add Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.SResult.html Example of collecting Results, demonstrating successful addition and error handling for overflow. ```rust let v = vec![1, 2]; let res: Result, &'static str> = v.iter().map(|x: &u32| x.checked_add(1).ok_or("Overflow!") ).collect(); assert_eq!(res, Ok(vec![2, 3])); ``` -------------------------------- ### log_on Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Server.html Logs the server into a generic Steam account using a provided token. ```APIDOC ## log_on ### Description Login to a generic account by token ### Method `log_on(token: &str)` ``` -------------------------------- ### init_for_game_server Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Initializes the UGC interface for a Steam game server. ```APIDOC ## init_for_game_server ### Description Initialize this UGC interface for a Steam game server. ### Method `&self` ### Parameters * **workshop_depot** (u32) - Required - The Workshop depot ID (usually the app ID). * **folder** (str) - Required - The path to the directory where UGC content will be stored. ### Returns * **bool** - `true` upon success; otherwise, `false`. ``` -------------------------------- ### Get Co-play Game ID Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Gets the App ID of the game that the user played with someone on their recently-played-with list. ```rust pub fn coplay_game_played(&self) -> AppId ``` -------------------------------- ### PersonaChange Initialization Methods Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.PersonaChange.html Provides methods to create PersonaChange flag values. `empty` creates a value with no flags set, while `all` creates a value with all known flags set. ```rust pub const fn empty() -> PersonaChange ``` ```rust pub const fn all() -> PersonaChange ``` -------------------------------- ### Example Usage of NumberFilter Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.NumberFilter.html Demonstrates how to create a NumberFilter instance to filter lobbies by 'lobby_elo' greater than 1500. ```rust let elo_filter = NumberFilter( LobbyKey::new("lobby_elo"), 1500, ComparisonFilter::GreaterThan, ); ``` -------------------------------- ### Get Handle to a Specific Cloud File Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.RemoteStorage.html Returns a handle to a specific file in the Steam cloud storage by its name. The file does not need to exist to get a handle. ```rust pub fn file(&self, name: &str) -> SteamFile ``` -------------------------------- ### Type mismatch example for `recycle` Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Illustrates that the `recycle` method enforces type compatibility based on size and alignment. This example shows a compile-time error when attempting to recycle a Vec of `[u8; 2]` into a Vec of `[u8; 1]`, as their sizes differ. ```rust #![feature(vec_recycle, transmutability)] let vec: Vec<[u8; 2]> = Vec::new(); let _: Vec<[u8; 1]> = vec.recycle(); ``` -------------------------------- ### end_authentication_session Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.User.html Ends an authentication session that was started with `begin_authentication_session`. ```APIDOC ## end_authentication_session ### Description Ends an authentication session that was started with `begin_authentication_session`. This should be called when you are no longer playing with the specified entity. ### Method ```rust pub fn end_authentication_session(&self, user: SteamId) ``` ``` -------------------------------- ### Get Launch Command Line Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Returns the command line arguments if the game was launched via a Steam URL. Returns an empty string if launched through other means. ```rust pub fn launch_command_line(&self) -> String ``` -------------------------------- ### launch_command_line Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Returns the command line arguments if the game was launched via a Steam URL. Returns an empty string otherwise. ```APIDOC ## launch_command_line ### Description Returns the command line if the game was launched via Steam URL. If the game was not launched through Steam URL, this returns an empty string. See Steam API ### Method `&self` ### Returns * **String** - The command line arguments, or an empty string. ``` -------------------------------- ### Getting a Reference to Any Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.GameLobbyJoinRequested.html Converts &Trait to &Any. This is needed for dynamic dispatch. ```rust fn as_any(&self) -> &(dyn Any + 'static); ``` -------------------------------- ### P2P and SDR Configuration Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/enum.NetworkingConfigValue.html Configure P2P settings like STUN server lists and ICE transport, as well as SDR client configurations for relay and ping accuracy. ```rust P2PSTUNServerList = 29, P2PTransportICEEnable = 30, P2PTransportICEPenalty = 31, P2PTransportSDRPenalty = 106, SDRClientConsecutitivePingTimeoutsFailInitial = 107, SDRClientConsecutitivePingTimeoutsFail = 108, SDRClientMinPingsBeforePingAccurate = 109, SDRClientSingleSocket = 110, SDRClientForceRelayCluster = 111, SDRClientDebugTicketAddress = 112, SDRClientForceProxyAddr = 113, SDRClientFakeClusterPing = 114, ``` -------------------------------- ### Get AppId from GameId Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.GameId.html Returns the AppId associated with this GameId. ```rust pub fn app_id(&self) -> AppId ``` -------------------------------- ### Create an i64 NetworkingConfigEntry Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetworkingConfigEntry.html Use `new_int64` to create a configuration entry for a 64-bit integer value. Requires `NetworkingConfigValue` and an `i64`. ```rust pub fn new_int64( value_type: NetworkingConfigValue, value: i64, ) -> NetworkingConfigEntry ``` -------------------------------- ### Activate Invite Dialog with Connect String Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friends.html Opens an invite dialog to send a Rich Presence connect string to friends. Panics if the connect string contains a null byte. ```rust pub fn activate_invite_dialog_connect_string(&self, connect: &str) ##### §Panics Panics if the `connect` str contains a null byte. ``` -------------------------------- ### is_dlc_installed Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Returns whether the user owns and has the specified DLC installed. ```APIDOC ## is_dlc_installed ### Description Returns whether the user owns the specific dlc and has it installed. ### Method `&self` ### Parameters * **app_id** (AppId) - Description: The ID of the DLC to check. ### Returns * **bool** - True if the DLC is owned and installed, false otherwise. ``` -------------------------------- ### Get Vec Length Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Returns the number of elements currently in the vector. ```rust let a = vec![1, 2, 3]; assert_eq!(a.len(), 3); ``` -------------------------------- ### Get User Level Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.User.html Retrieves the current Steam level of the user. ```rust pub fn level(&self) -> u32 ``` -------------------------------- ### Download a Workshop Item Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Initiates the download of a specific workshop item. The `high_priority` flag can be set to `true` to prioritize this download over others. Returns `true` if the download was successfully initiated. ```rust pub fn download_item(&self, item: PublishedFileId, high_priority: bool) -> bool ``` -------------------------------- ### Get Account ID from SteamId Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.SteamId.html Returns the `AccountId` associated with this `SteamId`. ```rust pub fn account_id(&self) -> AccountId ``` -------------------------------- ### download_item Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Initiates the download of a specific workshop item. ```APIDOC ## download_item ### Description Initiates the download of a workshop item. ### Method `&self` ### Parameters * **item** (PublishedFileId) - Required - The ID of the item to download. * **high_priority** (bool) - Optional - Set to `true` to download with high priority. ### Returns * **bool** - `true` if the download was successfully initiated, `false` otherwise. ``` -------------------------------- ### pub fn repeat(&self, n: usize) -> String Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Creates a new `String` by repeating the string slice `n` times. ```APIDOC ## pub fn repeat(&self, n: usize) -> String ### Description Creates a new `String` by repeating a string `n` times. ### Parameters * `n` (usize) - The number of times to repeat the string. ### Returns `String` - A new string containing the original string repeated `n` times. ### Panics This function will panic if the capacity would overflow. ### Examples Basic usage: ```rust assert_eq!("abc".repeat(4), String::from("abcabcabcabc")); ``` A panic upon overflow: ⓘ```rust // this will panic at runtime let huge = "0123456789abcdef".repeat(usize::MAX); ``` ``` -------------------------------- ### type_id Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.QueryHandle.html Gets the TypeId of the QueryHandle. This is useful for runtime type identification. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method GET (conceptual) ### Endpoint N/A (Method call) ### Parameters None ### Response #### Success Response - **TypeId** (TypeId) - The unique identifier for the type of the QueryHandle instance. ``` -------------------------------- ### Create an i32 NetworkingConfigEntry Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetworkingConfigEntry.html Use `new_int32` to create a configuration entry for a 32-bit integer value. Requires `NetworkingConfigValue` and an `i32`. ```rust pub fn new_int32( value_type: NetworkingConfigValue, value: i32, ) -> NetworkingConfigEntry ``` -------------------------------- ### Get Friend's Name Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Retrieves the display name of the friend. ```rust pub fn name(&self) -> String ``` -------------------------------- ### Get Listen Socket Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetConnectionInfo.html Retrieves the listen socket associated with the connection, if any. ```rust pub fn listen_socket(&self) -> Option ``` -------------------------------- ### Setting Global Create Connection Signaling Callback Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/enum.NetworkingConfigValue.html Shows how to set a global callback that is invoked when a signaling object needs to be created for a locally initiated connection. This is relevant for P2P connections. ```cpp ISteamNetworkingSockets::ConnectP2P ``` -------------------------------- ### from Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.QueryHandle.html Creates a QueryHandle from a given value. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method POST (conceptual) ### Endpoint N/A (Method call) ### Parameters - **t** (T) - The value to convert. ### Response #### Success Response - **T** (T) - The converted value. ``` -------------------------------- ### Get Authentication Status Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_sockets/struct.NetworkingSockets.html Retrieves the current status of the authentication system. ```rust pub fn get_authentication_status( &self, ) -> Result ``` -------------------------------- ### Get End Reason Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.DisconnectedEvent.html Retrieves the reason why the network connection ended. ```rust pub fn end_reason(&self) -> NetConnectionEnd ``` -------------------------------- ### Get Lobby Owner Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Matchmaking.html Returns the `SteamId` of the current owner of the specified lobby. ```rust pub fn lobby_owner(&self, lobby: LobbyId) -> SteamId ``` -------------------------------- ### Get App Build ID Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Retrieves the build ID for the current app. ```rust pub fn app_build_id(&self) -> i32 ``` -------------------------------- ### Clone Implementation for InstallInfo Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.InstallInfo.html Provides methods to create a duplicate of an InstallInfo value or copy from another. ```rust fn clone(&self) -> InstallInfo ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### Type ID Implementation Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.AuthSessionTicketResponse.html Gets the TypeId of a type, part of the Any trait implementation. ```rust fn type_id(&self) -> TypeId; ``` -------------------------------- ### launch_query_param Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Retrieves a specific launch parameter if the game was run via a Steam URL. Reserved parameter names are handled. ```APIDOC ## launch_query_param ### Description Gets the associated launch parameter if the game is run via steam://run//?param1=value1;param2=value2;param3=value3 etc. Parameter names starting with the character ‘@’ are reserved for internal use and will always return an empty string. Parameter names starting with an underscore ‘_’ are reserved for steam features – they can be queried by the game, but it is advised that you don’t use param names beginning with an underscore for your own features. See Steam API ### Method `&self` ### Parameters * **key** (str) - Description: The key of the launch parameter to retrieve. ### Returns * **String** - The value of the launch parameter, or an empty string if not found or reserved. ``` -------------------------------- ### Get Connection End Reason Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetConnectionInfo.html Retrieves the reason for the connection ending, if applicable. ```rust pub fn end_reason(&self) -> Option ``` -------------------------------- ### init_authentication Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_sockets/struct.NetworkingSockets.html Initiates the process to become ready for authenticated communications by obtaining necessary certificates. It can be called at program initialization or to force a retry if a previous attempt failed. ```APIDOC ## init_authentication ### Description Indicate our desire to be ready participate in authenticated communications. If we are currently not ready, then steps will be taken to obtain the necessary certificates. (This includes a certificate for us, as well as any CA certificates needed to authenticate peers.) You can call this at program init time if you know that you are going to be making authenticated connections, so that we will be ready immediately when those connections are attempted. (Note that essentially all connections require authentication, with the exception of ordinary UDP connections with authentication disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don’t call this function, we will wait until a feature is utilized that that necessitates these resources. You can also call this function to force a retry, if failure has occurred. Once we make an attempt and fail, we will not automatically retry. In this respect, the behavior of the system after trying and failing is the same as before the first attempt: attempting authenticated communication or calling this function will call the system to attempt to acquire the necessary resources. You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t to monitor the status. Returns the current value that would be returned from GetAuthenticationStatus. ### Method `pub fn init_authentication(&self) -> Result` ``` -------------------------------- ### Get Message Data for NetworkingMessage Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetworkingMessage.html Retrieves a slice representing the message payload. ```rust pub fn data(&self) -> &[u8] ``` -------------------------------- ### Rust trim_prefix and trim_suffix Examples Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Demonstrates how to remove optional prefixes and suffixes from a string slice using `trim_prefix` and `trim_suffix`. These methods are useful for cleaning up string data and can be chained for complex operations. ```rust #![feature(trim_prefix_suffix)] // Prefix present - removes it assert_eq!("foo:bar".trim_prefix("foo:"), "bar"); assert_eq!("foofoo".trim_prefix("foo"), "foo"); // Prefix absent - returns original string assert_eq!("foo:bar".trim_prefix("bar"), "foo:bar"); // Method chaining example assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/"); ``` ```rust #![feature(trim_prefix_suffix)] // Suffix present - removes it assert_eq!("bar:foo".trim_suffix(":foo"), "bar"); assert_eq!("foofoo".trim_suffix("foo"), "foo"); // Suffix absent - returns original string assert_eq!("bar:foo".trim_suffix("bar"), "bar:foo"); // Method chaining example assert_eq!("".trim_prefix('<').trim_suffix('>'), "https://example.com/"); ``` -------------------------------- ### Accessing NetConnection Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.ConnectedEvent.html Gets an immutable reference to the NetConnection object associated with the ConnectedEvent. ```rust pub fn connection(&self) -> &NetConnection ``` -------------------------------- ### Get User Data Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.DisconnectedEvent.html Retrieves associated user data for the disconnected event. ```rust pub fn user_data(&self) -> i64 ``` -------------------------------- ### try_with_capacity_in Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Constructs a new, empty `Vec` with a specified capacity and allocator. This is a nightly-only experimental API. ```APIDOC ## pub fn try_with_capacity_in(capacity: usize, alloc: A) -> Result, TryReserveError> ### Description Constructs a new, empty `Vec` with at least the specified capacity and the provided allocator. The vector will be able to hold at least `capacity` elements without reallocating. ### Method `try_with_capacity_in` ### Parameters - `capacity` (usize): The minimum capacity for the vector. - `alloc` (A): The allocator to use for the vector. ### Response - `Result, TryReserveError>`: Ok containing the new vector if successful, or an error if allocation fails or capacity is too large. ### Errors - Returns an error if the capacity exceeds `isize::MAX` bytes, or if the allocator reports allocation failure. ### Constraints - `A: Allocator` ``` -------------------------------- ### Symmetric Connect and Local Port Configuration Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/enum.NetworkingConfigValue.html Configure symmetric connect behavior and the local virtual port for networking. ```rust SymmetricConnect = 21, LocalVirtualPort = 22, ``` -------------------------------- ### ItemState Constants Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.ItemState.html These constants represent predefined states for an item, such as subscribed, installed, or downloading. ```APIDOC ## ItemState Constants ### `ItemState::NONE` Represents an item state with no flags set. ### `ItemState::SUBSCRIBED` Indicates that the item is subscribed. ### `ItemState::LEGACY_ITEM` Indicates that the item is a legacy item. ### `ItemState::INSTALLED` Indicates that the item is installed. ### `ItemState::NEEDS_UPDATE` Indicates that the item requires an update. ### `ItemState::DOWNLOADING` Indicates that the item is currently downloading. ### `ItemState::DOWNLOAD_PENDING` Indicates that the item download is pending. ``` -------------------------------- ### is_app_installed Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Apps.html Checks if the user currently has the app with the given ID installed. This does not verify ownership. ```APIDOC ## is_app_installed ### Description Returns whether the user currently has the app with the given ID currently installed. This does not mean the user owns the game. ### Method `&self` ### Parameters * **app_id** (AppId) - Description: The ID of the app to check. ### Returns * **bool** - True if the app is installed, false otherwise. ``` -------------------------------- ### Initialize UGC for Game Server Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Initializes the UGC interface for a Steam game server. Requires the workshop depot ID and a folder path for storing UGC content. Returns `true` on success, `false` otherwise. ```rust pub fn init_for_game_server(&self, workshop_depot: u32, folder: &str) -> bool ``` -------------------------------- ### SpawnableList Implementation Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Enables spawning a list of bundles in a Bevy world, typically used for related entities like children. ```APIDOC ## SpawnableList for Vec ### Description Implements the `SpawnableList` trait for `Vec`, allowing a list of bundles to be spawned in a Bevy `World`. This is commonly used for spawning related entities, such as child entities. ### Methods - `spawn(ptr: MovingPtr<'_, Vec>, world: &mut World, entity: Entity)`: Spawns this list of changes in the given `World` relative to the specified `Entity`. - `size_hint(&self) -> usize`: Returns a size hint, used for reserving space in a `RelationshipTarget`. This value should be less than or equal to the actual size of the list. ``` -------------------------------- ### Get LobbyKey length Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Returns the length of the LobbyKey in bytes. This is not necessarily the character count. ```rust let len = "foo".len(); assert_eq!(3, len); assert_eq!("ƒoo".len(), 4); // fancy f! assert_eq!("ƒoo".chars().count(), 3); ``` -------------------------------- ### Get Formatted SteamID32 String Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.SteamId.html Returns the formatted SteamID32 string representation of this `SteamId`. ```rust pub fn steamid32(&self) -> String ``` -------------------------------- ### Getting a Mutable Reference to Any Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.GameLobbyJoinRequested.html Converts &mut Trait to &mut Any. This is needed for dynamic dispatch. ```rust fn as_any_mut(&mut self) -> &mut (dyn Any + 'static); ``` -------------------------------- ### From> for Vec Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Converts a BinaryHeap into a Vec with constant time complexity and no data movement or allocation. ```APIDOC ## From> for Vec ### Description Converts a `BinaryHeap` into a `Vec`. This conversion requires no data movement or allocation, and has constant time complexity. ### Method `From` trait implementation ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Vec** - A vector containing the elements from the binary heap. #### Response Example None ``` -------------------------------- ### Get Steam Timeline Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam timeline interface. ```rust pub fn timeline(&self) -> Timeline ``` -------------------------------- ### Create an f32 NetworkingConfigEntry Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetworkingConfigEntry.html Use `new_float` to create a configuration entry for a 32-bit floating-point value. Requires `NetworkingConfigValue` and an `f32`. ```rust pub fn new_float( value_type: NetworkingConfigValue, value: f32, ) -> NetworkingConfigEntry ``` -------------------------------- ### Get Steam Screenshots Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam screenshots interface. ```rust pub fn screenshots(&self) -> Screenshots ``` -------------------------------- ### from_raw_parts_in Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Creates a `Vec` directly from a pointer, length, capacity, and an allocator. This is a nightly-only experimental API. ```APIDOC ## pub unsafe fn from_raw_parts_in(ptr: *mut T, length: usize, capacity: usize, alloc: A) -> Vec ### Description Creates a `Vec` directly from a pointer, a length, a capacity, and an allocator. This is a nightly-only experimental API. ### Method `from_raw_parts_in` ### Parameters - `ptr` (*mut T): A raw mutable pointer to the data. - `length` (usize): The length of the vector. - `capacity` (usize): The capacity of the vector. - `alloc` (A): The allocator to use for the vector. ### Response - `Vec`: The created vector. ### Safety This function is unsafe because the caller must ensure that `ptr`, `length`, and `capacity` accurately represent a valid allocation, and that `alloc` is compatible with the allocation. ### Constraints - `A: Allocator` ``` -------------------------------- ### Get Steam User Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam user interface. ```rust pub fn user(&self) -> User ``` -------------------------------- ### Rust rsplitn Examples Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Demonstrates splitting a string into a specified number of parts from the right using `rsplitn`. Supports string and character delimiters. ```rust let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect(); assert_eq!(v, ["lamb", "little", "Mary had a"]); ``` ```rust let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, 'X').collect(); assert_eq!(v, ["leopard", "tiger", "lionX"]); ``` ```rust let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect(); assert_eq!(v, ["leopard", "lion::tiger"]); ``` -------------------------------- ### Get Steam Input Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam input interface. ```rust pub fn input(&self) -> Input ``` -------------------------------- ### Get Steam Friends Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam friends interface. ```rust pub fn friends(&self) -> Friends ``` -------------------------------- ### Splitting Strings with a Limit and Closure Pattern using splitn Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.LobbyKey.html Demonstrates `splitn` with a closure as the pattern, allowing for complex splitting logic while limiting the number of output substrings. ```Rust let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect(); assert_eq!(v, ["abc", "defXghi"]); ``` -------------------------------- ### Get Steam Apps Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam apps interface. ```rust pub fn apps(&self) -> Apps ``` -------------------------------- ### Friends::activate_invite_dialog_connect_string Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friends.html Opens an invite dialog that sends a Rich Presence connect string to friends. Panics if the `connect` str contains a null byte. ```APIDOC ## Friends::activate_invite_dialog_connect_string ### Description Opens an invite dialog that sends a Rich Presence connect string to friends. Panics if the `connect` str contains a null byte. ### Method `&self` ### Parameters #### Query Parameters - **connect** (str) - Required - The Rich Presence connect string. ### Response None ``` -------------------------------- ### Initializing Vec Elements with as_non_null Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Shows how to initialize a vector's elements using a `NonNull` pointer obtained with `as_non_null`, writing values and then setting the vector's length. Requires the `box_vec_non_null` nightly feature. ```rust #![feature(box_vec_non_null)] // Allocate vector big enough for 4 elements. let size = 4; let mut x: Vec = Vec::with_capacity(size); let x_ptr = x.as_non_null(); // Initialize elements via raw pointer writes, then set length. unsafe { for i in 0..size { x_ptr.add(i).write(i as i32); } x.set_len(size); } assert_eq!(&*x, &[0, 1, 2, 3]); ``` -------------------------------- ### Get Steam Networking Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam networking interface. ```rust pub fn networking(&self) -> Networking ``` -------------------------------- ### Server Initialization Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Server.html Attempts to initialize the Steamworks API for server usage. This function should be called once per program and requires specific network and server configuration details. It returns a Server instance and a Client instance on success, or a SteamAPIInitError on failure. ```APIDOC ## init ### Description Attempts to initialize the steamworks api and returns a server to access the rest of the api. This should only ever have one instance per a program. Currently the steamworks api doesn’t support IPv6. ### Method ``` pub fn init( ip: Ipv4Addr, game_port: u16, query_port: u16, server_mode: ServerMode, version: &str, ) -> Result<(Server, Client), SteamAPIInitError> ``` ### Errors This can fail if: * The steam client isn’t running * The app ID of the game couldn’t be determined. If the game isn’t being run through steam this can be provided by placing a `steam_appid.txt` with the ID inside in the current working directory * The game isn’t running on the same user/level as the steam client * The user doesn’t own a license for the game. * The app ID isn’t completely set up. ``` -------------------------------- ### Get Steam Matchmaking Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam matchmaking interface. ```rust pub fn matchmaking(&self) -> Matchmaking ``` -------------------------------- ### Get Steam Utils Interface - Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Client.html Returns an accessor to the Steam utils interface. ```rust pub fn utils(&self) -> Utils ``` -------------------------------- ### Initialize Server and Client Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Server.html Attempts to initialize the Steamworks API. This should be called once per program. It can fail if the Steam client isn't running, the app ID is incorrect, or the user lacks a license. Ensure 'steam_appid.txt' is in the working directory if not running through Steam. ```rust pub fn init( ip: Ipv4Addr, game_port: u16, query_port: u16, server_mode: ServerMode, version: &str, ) -> Result<(Server, Client), SteamAPIInitError> ``` -------------------------------- ### Create a String NetworkingConfigEntry Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetworkingConfigEntry.html Use `new_string` to create a configuration entry for a string value. Requires `NetworkingConfigValue` and a string slice (`&str`). ```rust pub fn new_string( value_type: NetworkingConfigValue, value: &str, ) -> NetworkingConfigEntry ``` -------------------------------- ### Initialize Authentication Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_sockets/struct.NetworkingSockets.html Indicates the desire to participate in authenticated communications by obtaining necessary certificates. Call this at program initialization for immediate readiness or to force a retry after a failure. Status can be monitored via GetAuthenticationStatus or SteamNetAuthenticationStatus_t. ```rust pub fn init_authentication( &self, ) -> Result ``` -------------------------------- ### Get Game Played by Friend Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Returns information about the game the friend is currently playing, if any. ```rust pub fn game_played(&self) -> Option ``` -------------------------------- ### Input Interface Methods Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Input.html Provides access to the steam input interface, allowing for initialization, controller state management, and input action handling. ```APIDOC ## Input Struct Documentation ### Description Provides access to the steam input interface. ### Methods #### `init(&self, explicitly_call_run_frame: bool) -> bool` Initializes the Steam Input interface. If `explicitly_call_run_frame` is true, `RunFrame` must be called manually each frame. Otherwise, Steam Input updates when `SteamAPI_RunCallbacks()` is called. #### `run_frame(&self)` Synchronizes API state with the latest Steam Input action data. This is automatically performed by `SteamAPI_RunCallbacks()`, but can be called directly before reading controller state for lower latency. Must be called before `GetConnectedControllers` returns handles. #### `get_connected_controllers(&self) -> Vec` Returns a list of the currently connected controller handles. #### `get_connected_controllers_slice(&self, controllers: impl AsMut<[u64]>) -> usize` Returns a list of the currently connected controller handles without allocating, along with the count of connected controllers. #### `set_input_action_manifest_file_path(&self, path: &str) -> bool` Allows loading a specific Action Manifest File locally. #### `get_action_set_handle(&self, action_set_name: &str) -> u64` Returns the associated ControllerActionSet handle for the specified controller. #### `get_input_type_for_handle(&self, input_handle: u64) -> InputType` Returns the input type for a given controller handle. #### `get_glyph_for_action_origin(&self, action_origin: EInputActionOrigin) -> String` Returns the glyph for a given input action origin. #### `get_string_for_action_origin(&self, action_origin: EInputActionOrigin) -> String` Returns the name of a given input action origin. #### `activate_action_set_handle(&self, input_handle: u64, action_set_handle: u64)` Reconfigures the controller to use the specified action set. This is an inexpensive operation and can be safely called repeatedly. #### `get_digital_action_handle(&self, action_name: &str) -> u64` Gets the handle for a specified digital action. #### `get_analog_action_handle(&self, action_name: &str) -> u64` Gets the handle for a specified analog action. #### `get_digital_action_data(&self, input_handle: u64, action_handle: u64) -> InputDigitalActionData_t` Returns the current state of the supplied digital game action. #### `get_analog_action_data(&self, input_handle: u64, action_handle: u64) -> InputAnalogActionData_t` Returns the current state of the supplied analog game action. #### `get_digital_action_origins(&self, input_handle: u64, action_set_handle: u64, digital_action_handle: u64) -> Vec` Gets the origin(s) for a digital action within a specified action set. #### `get_analog_action_origins(&self, input_handle: u64, action_set_handle: u64, analog_action_handle: u64) -> Vec` Gets the origin(s) for an analog action within a specified action set. #### `get_motion_data(&self, input_handle: u64) -> InputMotionData_t` Retrieves motion data for a given input handle. #### `show_binding_panel(&self, input_handle: u64) -> bool` Invokes the Steam overlay to display the binding screen. Returns `true` on success, `false` if the overlay is disabled or unavailable. The configuration opens in the overlay for Big Picture Mode, or in a popup window for desktop mode. #### `shutdown(&self)` Shuts down the Steam Input interface. This must be called when ending use of the interface. ``` -------------------------------- ### Get Friend's Online State Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Retrieves the current online status of the friend. ```rust pub fn state(&self) -> FriendState ``` -------------------------------- ### Get Friend's Steam ID Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Friend.html Retrieves the unique Steam ID for a friend. ```rust pub fn id(&self) -> SteamId ``` -------------------------------- ### Initializing Vec Elements with as_mut_ptr Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html Shows how to initialize a vector's elements by writing to its buffer via a mutable raw pointer obtained with `as_mut_ptr`, followed by setting the vector's length. ```rust // Allocate vector big enough for 4 elements. let size = 4; let mut x: Vec = Vec::with_capacity(size); let x_ptr = x.as_mut_ptr(); // Initialize elements via raw pointer writes, then set length. unsafe { for i in 0..size { *x_ptr.add(i) = i as i32; } x.set_len(size); } assert_eq!(&*x, &[0, 1, 2, 3]); ``` -------------------------------- ### AchievementHelper::type_id Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/stats/struct.AchievementHelper.html Gets the `TypeId` of the `AchievementHelper` instance. This is useful for runtime type identification. ```APIDOC ## AchievementHelper::type_id ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns `TypeId` - The unique type identifier of the instance. ``` -------------------------------- ### Creating a Vec from externally allocated memory Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.NearFilters.html This example shows how to create a `Vec` using memory allocated with `std::alloc::alloc`. It's crucial that the memory layout (size and alignment) matches the requirements of the `Vec`'s element type and the capacity. The pointer must be non-null and correctly aligned. ```rust use std::alloc::{alloc, Layout}; fn main() { let layout = Layout::array::(16).expect("overflow cannot happen"); let vec = unsafe { let mem = alloc(layout).cast::(); if mem.is_null() { return; } mem.write(1_000_000); Vec::from_raw_parts(mem, 1, 16) }; assert_eq!(vec, &[1_000_000]); assert_eq!(vec.capacity(), 16); } ``` -------------------------------- ### Get Ping Time Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.NetConnectionRealTimeInfo.html Retrieves the current ping time for the network connection in milliseconds. ```rust pub fn ping(&self) -> i32 ``` -------------------------------- ### CloneToUninit Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.FriendFlags.html Provides a method to clone data into an uninitialized memory location. This is an experimental, nightly-only feature. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. ### Method `clone_to_uninit` ### Parameters - `dest` (*mut u8) - Description: Pointer to the destination memory location. ### Safety This is an unsafe function and requires `unsafe` block to call. It is nightly-only and experimental. ``` -------------------------------- ### Get Connection Name Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_sockets/struct.NetConnection.html Fetches the name of the connection. Returns false if the handle is invalid. ```rust pub fn connection_name(&self) -> Result<(), InvalidHandle> ``` -------------------------------- ### Begin Authentication Session Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.User.html Initiates an authentication session for a given user and ticket to verify its validity and prevent reuse. A callback will indicate if the user goes offline or cancels the ticket. This requires calling `end_authentication_session` upon session termination. ```rust pub fn begin_authentication_session( &self, user: SteamId, ticket: &[u8], ) -> Result<(), AuthSessionError> ``` -------------------------------- ### Get Remote Identity Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/networking_types/struct.DisconnectedEvent.html Retrieves the networking identity of the remote endpoint for the disconnected event. ```rust pub fn remote(&self) -> NetworkingIdentity ``` -------------------------------- ### Get Item Download Information Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Retrieves download information for a workshop item, including the total size and downloaded size. Returns `None` if the item is not available or has no download info. ```rust pub fn item_download_info(&self, item: PublishedFileId) -> Option<(u64, u64)> ``` -------------------------------- ### set_product Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.Server.html Sets the game product identifier. This is required for all game servers and must be set before logging on. ```APIDOC ## set_product ### Description Sets the game product identifier. This is currently used by the master server for version checking purposes. Converting the games app ID to a string for this is recommended. This is required for all game servers and can only be set before calling log_on() or log_on_anonymous(). ### Method `set_product(product: &str)` ``` -------------------------------- ### Collecting Results with checked_sub Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/type.SResult.html Example of collecting Results, demonstrating error handling for underflow. ```rust let v = vec![1, 2, 0]; let res: Result, &'static str> = v.iter().map(|x: &u32| x.checked_sub(1).ok_or("Underflow!") ).collect(); assert_eq!(res, Err("Underflow!")); ``` -------------------------------- ### From and Into Implementations Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/enum.LeaderboardSortMethod.html Facilitates conversions between types where LeaderboardSortMethod is the source or target, simplifying type manipulation. ```rust fn from(t: T) -> T ``` ```rust fn into(self) -> U ``` -------------------------------- ### Create a Workshop Item Source: https://docs.rs/bevy-steamworks/latest/bevy_steamworks/struct.UGC.html Initiates the creation of a new workshop item. This function is asynchronous and requires a callback to handle the result, which includes the published file ID and a boolean indicating if it's a new item. ```rust pub fn create_item(&self, app_id: AppId, file_type: FileType, cb: F) where F: FnOnce(Result<(PublishedFileId, bool), SteamError>) + 'static + Send, ```