[−][src]Struct genie_cpx::Campaign
A campaign file containing scenario files.
Methods
impl<R> Campaign<R> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn from(input: R) -> Result<Self>
[src]
Create a campaign instance from a readable input.
This immediately reads the campaign header and scenario metadata, but not the scenario files themselves.
pub fn into_inner(self) -> R
[src]
Consume this Campaign instance and get the reader.
pub fn version(&self) -> CPXVersion
[src]
Get the campaign file version.
pub fn name(&self) -> &str
[src]
pub fn entries(&self) -> impl Iterator<Item = &ScenarioMeta>
[src]
Iterate over the scenario metadata for this campaign.
pub fn len(&self) -> usize
[src]
Get the number of scenarios in this campaign.
pub fn is_empty(&self) -> bool
[src]
pub fn get_name(&self, id: usize) -> Option<&str>
[src]
pub fn get_filename(&self, id: usize) -> Option<&str>
[src]
pub fn by_name(&mut self, filename: &str) -> Result<Scenario>
[src]
Get a scenario by its file name.
pub fn by_index(&mut self, index: usize) -> Result<Scenario>
[src]
Get a scenario by its campaign index.
pub fn by_name_raw(&mut self, filename: &str) -> Result<Vec<u8>>
[src]
Get a scenario file buffer by its file name.
pub fn by_index_raw(&mut self, index: usize) -> Result<Vec<u8>>
[src]
Get a scenario file buffer by its campaign index.
impl<R> Campaign<R> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn write_to<W: Write>(&mut self, output: &mut W) -> Result<()>
[src]
Write the scenario file to an output stream.
Trait Implementations
impl<R: Clone> Clone for Campaign<R> where
R: Read + Seek,
[src]
R: Read + Seek,
fn clone(&self) -> Campaign<R>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<R: Debug> Debug for Campaign<R> where
R: Read + Seek,
[src]
R: Read + Seek,
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,