pub fn load_from_file<P, V>(p: P) -> Option<V>
    where
        P: AsRef<Path>,
        V: for<'d> Deserialize<'d>,
    {
        let p = env::workflow_cache()
            .and_then(|wfc| p.as_ref().file_name().map(|name| wfc.join(name)))?;
        debug!("loading from: {}", p.to_str().expect(""));
        Self::read_data_from_disk(&p).ok()
    }
/// Function to load some (temporary) data from file named `p` in workflow's cache dir
///
/// This function is provided so that workflow authors can retrieve temporarily information
/// saved to workflow's cache dir. The saved data is considered to be irrelevant to workflow's
/// actual data (for which you should use [`set`] and [`get`])
///
/// # Example
///
/// ```rust,no_run
/// # extern crate alfred_rs;
/// use alfred_rs::data::Data;
///
/// let cached_tags: Vec<String> = Data::load_from_file("cached_tags.dat").unwrap();
/// ```
///
/// ## Note
/// Only the [`file_name`] portion of `p` will be used to name the file, which will then be
/// looked up in workflow's cache directory.
///
/// [`set`]: struct.Data.html#method.set
/// [`get`]: struct.Data.html#method.get
/// [`file_name`]: https://doc.rust-lang.org/std/path/struct.Path.html#method.file_name
Function to load some (temporary) data from file named `p` in workflow's cache dir
This function is provided so that workflow authors can retrieve temporarily information
saved to workflow's cache dir. The saved data is considered to be irrelevant to workflow's
actual data (for which you should use [`set`] and [`get`])
Function to load some ( temporary ) data from file named ` p ` in workflow ' s cache dir This function is provided so that workflow authors can retrieve temporarily information saved to workflow ' s cache dir . The saved data is considered to be irrelevant to workflow ' s actual data ( for which you should use [ ` set ` ] and [ ` get ` ] )
pub fn load_from_file<P, V>(p: P) -> Option<V>
    where
        P: AsRef<Path>,
        V: for<'d> Deserialize<'d>,
    {
        let p = env::workflow_cache()
            .and_then(|wfc| p.as_ref().file_name().map(|name| wfc.join(name)))?;
        debug!("loading from: {}", p.to_str().expect(""));
        Self::read_data_from_disk(&p).ok()
    }
pub fn load_from_file < P , V > ( p : P ) -> Option < V > where P : AsRef < Path > , V : for < ' d > Deserialize < ' d > , { let p = env :: workflow_cache ( ) . and_then ( | wfc | p . as_ref ( ) . file_name ( ) . map ( | name | wfc . join ( name ) ) ) ? ; debug ! ( " " p to_str ( ) expect ( " " ) ) ; Self :: read_data_from_disk ( & p ) . ok ( ) }
Function to load some (temporary) data from file named `p` in workflow's cache dir
This function is provided so that workflow authors can retrieve temporarily information
saved to workflow's cache dir.
Function to load some ( temporary ) data from file named ` p ` in workflow ' s cache dir This function is provided so that workflow authors can retrieve temporarily information saved to workflow ' s cache dir .
p
P
p
P
example
None
extern crate alfred_rs;
use alfred_rs::data::Data.

let cached_tags: Vec = Data::load_from_file("cached_tags.dat").unwrap();
```
use alfred_rs :: data :: Data . let cached_tags : Vec = Data :: load_from_file ( " cached_tags . dat " ) . unwrap () ; ` ` `
note
Only the [`file_name`] portion of `p` will be used to name the file, which will then be
looked up in workflow's cache directory.


Only the [ ` file_name ` ] portion of ` p ` will be used to name the file which will then be looked up in workflow ' s cache directory .