[−][src]Struct exr::meta::attributes::Text
A byte array with each byte being a char. This is not UTF an must be constructed from a standard string.
Methods
impl Text
[src]
pub fn bytes(&self) -> &[u8]
[src]
The internal ASCII bytes this text is made of.
pub fn from(str: impl AsRef<str>) -> Option<Self>
[src]
Create a Text
from an str
reference.
Returns None
if this string contains unsupported chars.
pub fn from_bytes_unchecked(bytes: SmallVec<[u8; 24]>) -> Self
[src]
Create a Text
from the specified bytes object,
without checking any of the bytes.
pub fn validate(
&self,
null_terminated: bool,
long_names: Option<bool>
) -> UnitResult
[src]
&self,
null_terminated: bool,
long_names: Option<bool>
) -> UnitResult
Check whether this string is valid, considering the maximum text length.
pub fn validate_bytes(
text: &[u8],
null_terminated: bool,
long_names: Option<bool>
) -> UnitResult
[src]
text: &[u8],
null_terminated: bool,
long_names: Option<bool>
) -> UnitResult
Check whether some bytes are valid, considering the maximum text length.
pub fn null_terminated_byte_size(&self) -> usize
[src]
The byte count this string would occupy if it were encoded as a null-terminated string.
pub fn i32_sized_byte_size(&self) -> usize
[src]
The byte count this string would occupy if it were encoded as a size-prefixed string.
pub fn write_i32_sized<W: Write>(&self, write: &mut W) -> UnitResult
[src]
Write the length of a string and then the contents with that length.
pub fn read_i32_sized<R: Read>(read: &mut R, max_size: usize) -> Result<Self>
[src]
Read the length of a string and then the contents with that length.
pub fn read_sized<R: Read>(read: &mut R, size: usize) -> Result<Self>
[src]
Read the contents with that length.
pub fn write_null_terminated<W: Write>(&self, write: &mut W) -> UnitResult
[src]
Write the string contents and a null-terminator.
pub fn read_null_terminated<R: Read>(
read: &mut R,
max_len: usize
) -> Result<Self>
[src]
read: &mut R,
max_len: usize
) -> Result<Self>
Read a string until the null-terminator is found. Then skips the null-terminator.
Trait Implementations
impl Clone for Text
[src]
impl Debug for Text
[src]
impl Display for Text
[src]
impl Eq for Text
[src]
impl Hash for Text
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<String> for Text
[src]
impl Ord for Text
[src]
fn cmp(&self, other: &Text) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Text> for Text
[src]
impl PartialOrd<Text> for Text
[src]
fn partial_cmp(&self, other: &Text) -> Option<Ordering>
[src]
fn lt(&self, other: &Text) -> bool
[src]
fn le(&self, other: &Text) -> bool
[src]
fn gt(&self, other: &Text) -> bool
[src]
fn ge(&self, other: &Text) -> bool
[src]
impl StructuralEq for Text
[src]
impl StructuralPartialEq for Text
[src]
impl<'s> TryFrom<&'s str> for Text
[src]
Auto Trait Implementations
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Wfn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,