[][src]Struct genie_cpx::Campaign

pub struct Campaign<R> where
    R: Read + Seek
{ /* fields omitted */ }

A campaign file containing scenario files.

Methods

impl<R> Campaign<R> where
    R: Read + Seek
[src]

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]

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]

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]

Auto Trait Implementations

impl<R> Send for Campaign<R> where
    R: Send

impl<R> Sync for Campaign<R> where
    R: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.