[][src]Struct factorio_blueprint::BlueprintCodec

pub struct BlueprintCodec;

Utility class which knows how to convert JSON to and from Factorio's blueprint string format.

Implementations

impl BlueprintCodec[src]

pub fn encode_writer<W, F>(writer: W, inner: F) -> Result<()> where
    W: Write,
    F: FnOnce(ZlibEncoder<&mut Base64Encoder<'_, VersionPrefixWriter<W>>>) -> Result<()>, 
[src]

writer adaptor which encodes json data to blueprint string format

typically it is more useful to use encode instead, but this method provides some extra flexibility.

pub fn encode<W: Write>(writer: W, container: &Container) -> Result<()>[src]

write the blueprint string to the given writer

pub fn encode_string(container: &Container) -> Result<String>[src]

produce a new owned string containing the blueprint string

pub fn decode_reader<R, F>(reader: R, inner: F) -> Result<()> where
    R: Read,
    F: FnOnce(ZlibDecoder<Base64Decoder<'_, VersionPrefixReader<WhitespaceRemover<R>>>>) -> Result<()>, 
[src]

reader adaptor which decodes a blueprint string to json

typically it is more useful to use decode instead, but this method gives flexibility in the event that it is required

pub fn decode<R: Read>(reader: R) -> Result<Container>[src]

read the blueprint string from the given reader

pub fn decode_string(blueprint: &str) -> Result<Container>[src]

read the blueprint string from the given input

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.