[−][src]Struct arma_preset_parser::Preset
Preset struct. Stores the preset name and a vector of all the mods
Fields
name: String
mods: Vec<Mod>
Implementations
impl Preset
[src]
pub fn from_file(file: File) -> Result<Self, ParserError>
[src]
This function returns a preset from a file object
Examples
match std::fs::File::open(some_path) { Ok(file) => { match arma_preset_parser::Preset::from_file(file) { Ok(preset) => println!("{:?}", preset), Err(e) => println!("{}", e) }; }, Err(e) => println!("{}", e) };
pub fn from_fs(path: String) -> Result<Self, ParserError>
[src]
This function returns a preset from a String filepath
Examples
match arma_preset_parser::Preset::from_fs("some_path".parse().unwrap()) { Ok(preset) => println!("{:?}", preset), Err(e) => println!("{}", e) };
pub fn as_mods(&self) -> Vec<Mod>
[src]
This function returns a vector of mods from a preset
Examples
match arma_preset_parser::Preset::from_fs("some_path".parse().unwrap()) { Ok(preset) => println!("{:?}", preset.as_mods()), Err(e) => println!("{}", e) };
pub fn as_ids(&self) -> Vec<i64>
[src]
This function returns a vector of mod ids from a preset
Examples
match arma_preset_parser::Preset::from_fs("some_path".parse().unwrap()) { Ok(preset) => println!("{:?}", preset.as_ids()), Err(e) => println!("{}", e) };
pub fn as_names(&self) -> Vec<String>
[src]
This function returns a vector of mod names from a preset
Examples
match arma_preset_parser::Preset::from_fs("some_path".parse().unwrap()) { Ok(preset) => println!("{:?}", preset.as_names()), Err(e) => println!("{}", e) };
pub fn as_links(&self) -> Vec<String>
[src]
This function returns a vector of mod names from a preset
Examples
match arma_preset_parser::Preset::from_fs("some_path".parse().unwrap()) { Ok(preset) => println!("{:?}", preset.as_links()), Err(e) => println!("{}", e) };
Trait Implementations
impl Debug for Preset
[src]
impl PartialEq<Preset> for Preset
[src]
impl StructuralPartialEq for Preset
[src]
Auto Trait Implementations
impl RefUnwindSafe for Preset
impl Send for Preset
impl Sync for Preset
impl Unpin for Preset
impl UnwindSafe for Preset
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,