pub struct UsdcFileFormat;Expand description
Binary crate format (.usdc) as an sdf::FileFormat, wrapping
CrateData and CrateWriter. Also the default writer for the ambiguous
.usd extension (C++ USD_WRITE_NEW_USD_FILES_AS_BINARY).
Trait Implementations§
Source§impl FileFormat for UsdcFileFormat
impl FileFormat for UsdcFileFormat
Source§fn format_id(&self) -> Token
fn format_id(&self) -> Token
The format’s stable identifier token (C++
SdfFileFormat::GetFormatId),
e.g. "usda".Source§fn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
File extensions this format claims, without the leading dot. The first
is the canonical one; additional entries (e.g.
usdc also claiming
usd) let one format be the default for an ambiguous extension.Source§fn read(
&self,
resolver: &dyn Resolver,
resolved: &ResolvedPath,
) -> Result<LayerData>
fn read( &self, resolver: &dyn Resolver, resolved: &ResolvedPath, ) -> Result<LayerData>
Read a layer’s data from
resolved, opening the asset (and any
sibling assets) through resolver.Source§fn matches_content(&self, prefix: &[u8]) -> bool
fn matches_content(&self, prefix: &[u8]) -> bool
Whether this format can read an asset whose leading bytes are
prefix
(C++ SdfFileFormat::CanRead). Used to disambiguate an extension claimed
by more than one format — binary vs text .usd — by content. The default
has no content signature; a binary format overrides it to match its magic.Source§fn write(&self, data: &dyn AbstractData, sink: &mut dyn WriteSeek) -> Result<()>
fn write(&self, data: &dyn AbstractData, sink: &mut dyn WriteSeek) -> Result<()>
Serialize
data to sink in this format.Source§fn caps(&self) -> FileFormatCaps
fn caps(&self) -> FileFormatCaps
The operations this format supports (C++
SdfFileFormat’s
supportsReading/Writing/Editing plugInfo flags). Defaults to all
three; an asymmetric encoding (e.g. an import-only third-party format)
overrides this to drop a flag.
Layer::export rejects a format lacking
WRITE.Source§fn resolve_layer(
&self,
_resolver: &dyn Resolver,
resolved: &ResolvedPath,
) -> Option<ResolvedPath>
fn resolve_layer( &self, _resolver: &dyn Resolver, resolved: &ResolvedPath, ) -> Option<ResolvedPath>
Resolves the real path of the layer to open at
resolved — the location
it physically loads from and anchors its relative asset paths against
(C++ SdfLayer::GetRealPath) — or None if this format cannot read it
there. Read moreAuto Trait Implementations§
impl Freeze for UsdcFileFormat
impl RefUnwindSafe for UsdcFileFormat
impl Send for UsdcFileFormat
impl Sync for UsdcFileFormat
impl Unpin for UsdcFileFormat
impl UnsafeUnpin for UsdcFileFormat
impl UnwindSafe for UsdcFileFormat
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