Struct exr::meta::attribute::Text [−][src]
pub struct Text { /* fields omitted */ }
Expand description
A byte array with each byte being a char. This is not UTF an must be constructed from a standard string.
Implementations
impl Text
[src]
impl Text
[src]pub fn new_or_none(string: impl AsRef<str>) -> Option<Self>
[src]
pub fn new_or_none(string: impl AsRef<str>) -> Option<Self>
[src]Create a Text
from an str
reference.
Returns None
if this string contains unsupported chars.
pub fn new_or_panic(string: impl AsRef<str>) -> Self
[src]
pub fn new_or_panic(string: impl AsRef<str>) -> Self
[src]Create a Text
from an str
reference.
Panics if this string contains unsupported chars.
pub fn from_slice_unchecked(text: &TextSlice) -> Self
[src]
pub fn from_slice_unchecked(text: &TextSlice) -> Self
[src]Create a Text
from a slice of bytes,
without checking any of the bytes.
pub fn from_bytes_unchecked(bytes: TextBytes) -> Self
[src]
pub fn from_bytes_unchecked(bytes: TextBytes) -> 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<&mut bool>
) -> UnitResult
[src]
pub fn validate(
&self,
null_terminated: bool,
long_names: Option<&mut bool>
) -> UnitResult
[src]Check whether this string is valid, adjusting long_names
if required.
If long_names
is not provided, text length will be entirely unchecked.
pub fn validate_bytes(
text: &TextSlice,
null_terminated: bool,
long_names: Option<&mut bool>
) -> UnitResult
[src]
pub fn validate_bytes(
text: &TextSlice,
null_terminated: bool,
long_names: Option<&mut bool>
) -> UnitResult
[src]Check whether some bytes are valid, adjusting long_names
if required.
If long_names
is not provided, text length will be entirely unchecked.
pub fn null_terminated_byte_size(&self) -> usize
[src]
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]
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]
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]
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]
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]
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]
pub fn read_null_terminated<R: Read>(
read: &mut R,
max_len: usize
) -> Result<Self>
[src]Read a string until the null-terminator is found. Then skips the null-terminator.
pub fn chars(&self) -> impl '_ + Iterator<Item = char>
[src]
pub fn chars(&self) -> impl '_ + Iterator<Item = char>
[src]Iterate over the individual chars in this text, similar to String::chars()
.
Does not do any heap-allocation but borrows from this instance instead.
pub fn eq_case_insensitive(&self, string: &str) -> bool
[src]
pub fn eq_case_insensitive(&self, string: &str) -> bool
[src]Compare this exr::Text
with a plain &str
ignoring capitalization.
Trait Implementations
impl Ord for Text
[src]
impl Ord for Text
[src]impl PartialOrd<Text> for Text
[src]
impl PartialOrd<Text> for Text
[src]fn partial_cmp(&self, other: &Text) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Text) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Text
[src]
impl StructuralPartialEq 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
[src]
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
[src]fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
[src]
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
[src]Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
[src]
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
[src]Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
[src]
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
[src]Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more