pub struct RawArtifact {
pub bytes: Vec<u8>,
pub declared_media_type: Option<MediaType>,
}Expand description
Raw input bytes before media-type detection has completed.
§Examples
use truss::{RawArtifact, MediaType};
let raw = RawArtifact::new(vec![0xFF, 0xD8, 0xFF], Some(MediaType::Jpeg));
assert_eq!(raw.declared_media_type, Some(MediaType::Jpeg));
let unknown = RawArtifact::new(vec![1, 2, 3], None);
assert!(unknown.declared_media_type.is_none());Fields§
§bytes: Vec<u8>The raw input bytes.
declared_media_type: Option<MediaType>The media type declared by an adapter, if one is available.
Implementations§
Trait Implementations§
Source§impl Clone for RawArtifact
impl Clone for RawArtifact
Source§fn clone(&self) -> RawArtifact
fn clone(&self) -> RawArtifact
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawArtifact
impl Debug for RawArtifact
Source§impl PartialEq for RawArtifact
impl PartialEq for RawArtifact
impl Eq for RawArtifact
impl StructuralPartialEq for RawArtifact
Auto Trait Implementations§
impl Freeze for RawArtifact
impl RefUnwindSafe for RawArtifact
impl Send for RawArtifact
impl Sync for RawArtifact
impl Unpin for RawArtifact
impl UnsafeUnpin for RawArtifact
impl UnwindSafe for RawArtifact
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more