pub struct SwContainer<R> { /* private fields */ }Expand description
A SOLIDWORKS 2015+ file opened from a file (or any seekable reader).
Implementations§
Source§impl<R: Read + Seek> SwContainer<R>
impl<R: Read + Seek> SwContainer<R>
Sourcepub fn open(reader: R) -> Result<Option<Self>>
pub fn open(reader: R) -> Result<Option<Self>>
Finds the sections. None if the file is not a SOLIDWORKS 2015+ file.
pub fn sections(&self) -> &[Section]
Sourcepub fn read(&mut self, name: &str, max: u64) -> Result<Option<Vec<u8>>>
pub fn read(&mut self, name: &str, max: u64) -> Result<Option<Vec<u8>>>
The uncompressed data of the named section, if it exists, is at most
max bytes long and inflates correctly (size and CRC-32). Should the
name occur more than once, the first section that inflates wins –
confirmed sections first (real files also hold header-like records
with the names of real sections before the signature is known). Of
each kind only the first MAX_TRIES are tried: each may inflate up
to max bytes before it fails, so a file full of bogus copies of one
section must not multiply that work.
Auto Trait Implementations§
impl<R> Freeze for SwContainer<R>where
R: Freeze,
impl<R> RefUnwindSafe for SwContainer<R>where
R: RefUnwindSafe,
impl<R> Send for SwContainer<R>where
R: Send,
impl<R> Sync for SwContainer<R>where
R: Sync,
impl<R> Unpin for SwContainer<R>where
R: Unpin,
impl<R> UnsafeUnpin for SwContainer<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for SwContainer<R>where
R: UnwindSafe,
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Parallelizable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.