#[non_exhaustive]pub enum ShapeError {
AlreadyShaped,
DirectionUnset,
DirectionMismatch {
plan: Direction,
buffer: Direction,
},
ScriptMismatch {
plan: Script,
buffer: Script,
},
}Expand description
The reason a call to shape could not produce glyphs.
Each of these is a misuse of the API. Running out of room is not among
them: pathological input can provoke it, so it is reported through
Buffer::allocation_successful
rather than as a failure to shape.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlreadyShaped
The buffer already holds the glyphs from an earlier call.
To shape the same contents again, set the content type back to
ContentType::Unicode with
set_content_type; to shape something else,
clear the buffer and fill it afresh.
DirectionUnset
The buffer has no direction, so no plan could be built for it.
Call guess_segment_properties to
infer one from the contents, or set it with
set_direction.
DirectionMismatch
The buffer’s direction is not the one the supplied plan was built for.
Fields
ScriptMismatch
The buffer’s script is not the one the supplied plan was built for.
Trait Implementations§
Source§impl Clone for ShapeError
impl Clone for ShapeError
Source§fn clone(&self) -> ShapeError
fn clone(&self) -> ShapeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShapeError
impl Debug for ShapeError
Source§impl Display for ShapeError
impl Display for ShapeError
impl Eq for ShapeError
Source§impl Error for ShapeError
Available on crate feature std only.
impl Error for ShapeError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()