Skip to main content

UsdcFileFormat

Struct UsdcFileFormat 

Source
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

Source§

fn format_id(&self) -> Token

The format’s stable identifier token (C++ SdfFileFormat::GetFormatId), e.g. "usda".
Source§

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>

Read a layer’s data from resolved, opening the asset (and any sibling assets) through resolver.
Source§

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<()>

Serialize data to sink in this format.
Source§

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>

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 more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.