[][src]Struct genie::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<Campaign<R>, ReadCampaignError>[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) -> [u8; 4][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, ReadCampaignError>[src]

Get a scenario by its file name.

pub fn by_index(&mut self, index: usize) -> Result<Scenario, ReadCampaignError>[src]

Get a scenario by its campaign index.

pub fn by_name_raw(
    &mut self,
    filename: &str
) -> Result<Vec<u8>, ReadCampaignError>
[src]

Get a scenario file buffer by its file name.

pub fn by_index_raw(
    &mut self,
    index: usize
) -> Result<Vec<u8>, ReadCampaignError>
[src]

Get a scenario file buffer by its campaign index.

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

pub fn write_to<W>(&mut self, output: &mut W) -> Result<(), WriteCampaignError> where
    W: Write
[src]

Write the scenario file to an output stream.

Trait Implementations

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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