[−][src]Enum ruby_string::Segment
A part of a RubyString
that either has no ruby glosses or exactly
one ruby gloss attached to it. This type appears:
- when iterating over the segments of a
RubyStrings
using itssegments
method, or - when
extend()
ing aRubyString
using animpl Iterator<Item = Segment>
, - when building a
RubyString
throughcollect()
on animpl Iterator<Item = Segment>
.
Variants
A piece of text that does not have any ruby glosses attached to it.
Fields of Plain
text: &'a str
A piece of text that has exactly one ruby gloss attached to its entirety.
Implementations
impl<'a> Segment<'a>
[src]
pub fn plain_text(&self) -> &'a str
[src]
Returns only the plain text in this segment, ignoring any ruby glosses attached to it.
pub fn to_interlinear_encoding(&self) -> String
[src]
Returns an encoding of this segment as a plain String using interlinear annotation characters.
let s = Segment::Plain { text: "です" }; assert_eq!(s.to_interlinear_encoding(), "です"); let s = Segment::Rubied { text: "東京", ruby: "とうきょう" }; assert_eq!(s.to_interlinear_encoding(), "\u{FFF9}東京\u{FFFA}とうきょう\u{FFFB}");
Trait Implementations
impl<'a> Clone for Segment<'a>
[src]
impl<'a> Copy for Segment<'a>
[src]
impl<'a> Debug for Segment<'a>
[src]
impl<'a> Eq for Segment<'a>
[src]
impl<'a> Extend<Segment<'a>> for RubyString
[src]
fn extend<I: IntoIterator<Item = Segment<'a>>>(&mut self, iter: I)
[src]
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl<'a> FromIterator<Segment<'a>> for RubyString
[src]
fn from_iter<I: IntoIterator<Item = Segment<'a>>>(iter: I) -> RubyString
[src]
impl<'a> PartialEq<Segment<'a>> for Segment<'a>
[src]
impl<'a> StructuralEq for Segment<'a>
[src]
impl<'a> StructuralPartialEq for Segment<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Segment<'a>
impl<'a> Send for Segment<'a>
impl<'a> Sync for Segment<'a>
impl<'a> Unpin for Segment<'a>
impl<'a> UnwindSafe for Segment<'a>
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> 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>,