#[non_exhaustive]pub enum Container {
Zip,
Gzip,
Xml,
}Expand description
The three ways a .ork file packages its design document.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Zip
A zip archive; the design is the rocket.ork entry. What OpenRocket writes today.
Gzip
A single gzip stream whose contents are the design document.
Xml
The design document itself, uncompressed.
Implementations§
Source§impl Container
impl Container
Sourcepub fn sniff(bytes: &[u8]) -> Option<Self>
pub fn sniff(bytes: &[u8]) -> Option<Self>
Names the container bytes are packed in, from its first bytes alone.
Zip archives begin PK followed by \x03\x04 (a local file header), \x05\x06 (an empty
archive) or \x07\x08 (a spanned one); gzip members begin \x1f\x8b. Anything else is
taken to be XML if, once a byte-order mark and leading whitespace are passed, it begins
with <. Returns None when it is none of the three.
Trait Implementations§
impl Copy for Container
Source§impl<'de> Deserialize<'de> for Container
impl<'de> Deserialize<'de> for Container
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Container
impl StructuralPartialEq for Container
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl UnwindSafe for Container
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.