pub struct ContentStructure(/* private fields */);Expand description
A validated description of how resources realize one representation.
Implementations§
Source§impl ContentStructure
impl ContentStructure
Sourcepub const fn single_resource(resource_id: ResourceId) -> Self
pub const fn single_resource(resource_id: ResourceId) -> Self
Creates a representation backed by one required resource.
Sourcepub const fn image_sequence(descriptor: ImageSequenceDescriptor) -> Self
pub const fn image_sequence(descriptor: ImageSequenceDescriptor) -> Self
Creates a representation backed by one compact image sequence.
Sourcepub fn ordered_parts(members: Vec<ResourceMember>) -> Result<Self>
pub fn ordered_parts(members: Vec<ResourceMember>) -> Result<Self>
Creates an ordered span whose members are all required.
§Errors
Returns ErrorKind::InvalidArgument when the membership is empty,
unbounded, duplicated, or contains an optional member.
Sourcepub fn package(members: Vec<ResourceMember>) -> Result<Self>
pub fn package(members: Vec<ResourceMember>) -> Result<Self>
Creates a package with at least one required member.
§Errors
Returns ErrorKind::InvalidArgument when the membership is empty,
unbounded, duplicated, or has no required member.
Sourcepub const fn kind(&self) -> ContentStructureKind
pub const fn kind(&self) -> ContentStructureKind
Returns the structure discriminator.
Sourcepub const fn single_resource_id(&self) -> Option<ResourceId>
pub const fn single_resource_id(&self) -> Option<ResourceId>
Returns the resource when this is a single-resource structure.
Sourcepub const fn image_sequence_descriptor(
&self,
) -> Option<&ImageSequenceDescriptor>
pub const fn image_sequence_descriptor( &self, ) -> Option<&ImageSequenceDescriptor>
Returns the descriptor when this is an image sequence.
Sourcepub fn members(&self) -> Option<&[ResourceMember]>
pub fn members(&self) -> Option<&[ResourceMember]>
Returns members for an ordered or package structure.
Sourcepub fn resource_ids(&self) -> Vec<ResourceId>
pub fn resource_ids(&self) -> Vec<ResourceId>
Returns referenced resources in structural order.
Trait Implementations§
Source§impl Clone for ContentStructure
impl Clone for ContentStructure
Source§fn clone(&self) -> ContentStructure
fn clone(&self) -> ContentStructure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentStructure
impl Debug for ContentStructure
impl Eq for ContentStructure
Source§impl PartialEq for ContentStructure
impl PartialEq for ContentStructure
Source§fn eq(&self, other: &ContentStructure) -> bool
fn eq(&self, other: &ContentStructure) -> bool
self and other values to be equal, and is used by ==.