pub enum FoundPattern {
Loaded(Arc<Pattern>),
Unusable,
Missing,
}Expand description
What scn found when it named a pattern.
The two halves are separate because finding the resource and loading the
pattern fail differently. Finding it checks only that the resource exists
and is a dictionary or a stream; that is what decides whether scn
installs a pattern colour at all. Whether the pattern is usable — a
/PatternType it recognises, a shading it can validate, steps it can tile
with — is answered later, at draw time, and a failure there means the
object paints nothing.
Collapsing the two makes an scn naming an unusable pattern a no-op, so
the object keeps whatever colour was current and paints solid. On a
page-sized rectangle over the default black that is an entirely black
page, which is what four of the corpus’s fuzz files produced.
Variants§
Loaded(Arc<Pattern>)
The resource exists and the pattern loaded.
Unusable
The resource exists but the pattern is unusable: a pattern colour is still installed, and it paints nothing.
Missing
No such resource, or it is neither a dictionary nor a stream. scn is
a no-op and the previous colour stands.
Trait Implementations§
Source§impl Clone for FoundPattern
impl Clone for FoundPattern
Source§fn clone(&self) -> FoundPattern
fn clone(&self) -> FoundPattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more