[−][src]Struct conrod_core::text::line::Info
Information about a single line of text within a &str
.
Info
is a minimal amount of information that can be stored for efficient reasoning about
blocks of text given some &str
. The start
and end_break
can be used for indexing into
the &str
, and the width
can be used for calculating line Rect
s, alignment, etc.
Fields
start_byte: usize
The index into the &str
that represents the first character within the line.
start_char: usize
The character index of the first character in the line.
end_break: Break
The index within the &str
at which this line breaks into a new line, along with the
index at which the following line begins. The variant describes whether the break is
caused by a Newline
character or a Wrap
by the given wrap function.
width: Scalar
The total width of all characters within the line.
Implementations
impl Info
[src]
pub fn end_byte(&self) -> usize
[src]
The end of the byte index range for indexing into the slice.
pub fn end_char(&self) -> usize
[src]
The end of the index range for indexing into the slice.
pub fn byte_range(self) -> Range<usize>
[src]
The index range for indexing (via bytes) into the original str slice.
pub fn char_range(self) -> Range<usize>
[src]
The index range for indexing into a char
iterator over the original str slice.
Trait Implementations
impl Clone for Info
[src]
impl Copy for Info
[src]
impl Debug for Info
[src]
impl PartialEq<Info> for Info
[src]
impl StructuralPartialEq for Info
[src]
Auto Trait Implementations
impl RefUnwindSafe for Info
impl Send for Info
impl Sync for Info
impl Unpin for Info
impl UnwindSafe for Info
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,
fn 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> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<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, 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>,