[−][src]Struct factorio_blueprint::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]
W: Write,
F: FnOnce(ZlibEncoder<&mut Base64Encoder<'_, VersionPrefixWriter<W>>>) -> Result<()>,
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]
R: Read,
F: FnOnce(ZlibDecoder<Base64Decoder<'_, VersionPrefixReader<WhitespaceRemover<R>>>>) -> Result<()>,
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
impl RefUnwindSafe for BlueprintCodec
impl Send for BlueprintCodec
impl Sync for BlueprintCodec
impl Unpin for BlueprintCodec
impl UnwindSafe for BlueprintCodec
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>,