Function streambed_storage::load_struct
source ยท pub async fn load_struct<T, D, DE>(
state_storage_path: &Path,
ss: &impl SecretStore,
secret_path: &str,
deserialize: D,
) -> Result<T, Box<dyn Error>>Expand description
Loads and deserializes a structure described by T, if the file is present. If there are IO issues outside of the file not being there, they will be returned as an error. Beyond IO, state is attempted to be decrypted and deserialized when present. Any issues there cause the default representation of the structure to be returned. The default structure is also returned where there is no file present in the first place.