[−][src]Struct genie_cpx::CampaignWriter
A campaign file writer. Instantiate it, then add scenario files to it.
This has to keep all scenario files in memory until the file is written, either on a call to flush()
or implicitly when the struct is dropped.
Implementations
impl<W: Write> CampaignWriter<W>
[src]
pub fn new(name: &str, writer: W) -> Self
[src]
Create a new campaign with user-visible name name
, writing to the writer
stream.
pub fn version(self, version: CPXVersion) -> Self
[src]
Set the file version to output.
pub fn add_raw(&mut self, name: &str, filename: &str, scx: Vec<u8>)
[src]
Add a scenario (as a byte array) to this campaign.
pub fn add(&mut self, name: &str, scx: &Scenario) -> SCXResult<()>
[src]
Add a Scenario instance from genie-scx to this campaign.
This returns a Result because it serializes the scenario to an in-memory byte array, which may fail.
pub fn into_inner(self) -> W
[src]
Consume the CampaignWriter
instance, returning the inner Write
instance.
pub fn flush(self) -> Result<W>
[src]
Write the scenarios to the output stream, consuming the CampaignWriter object.
Returns the inner Write
.
Auto Trait Implementations
impl<W> RefUnwindSafe for CampaignWriter<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for CampaignWriter<W> where
W: Send,
W: Send,
impl<W> Sync for CampaignWriter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for CampaignWriter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for CampaignWriter<W> where
W: UnwindSafe,
W: UnwindSafe,
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>,