Enum reinda::EmbeddedEntry
source · #[non_exhaustive]pub enum EmbeddedEntry {
Single(EmbeddedFile),
Glob(EmbeddedGlob),
}
Expand description
Corresponds to one entry in the files
array specified in
embed!
, either a single file or a glob.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Single(EmbeddedFile)
A single embedded file. The corresponding entry in the macro did not contain any glob meta characters (or only escaped ones).
Glob(EmbeddedGlob)
An entry in the macro with glob meta characters, matching potentially multiple files.
Implementations§
source§impl EmbeddedEntry
impl EmbeddedEntry
sourcepub fn embed_pattern(&self) -> &'static str
pub fn embed_pattern(&self) -> &'static str
Returns the embed pattern, which is the path or pattern string
specified in the macro for this entry. That’s either
EmbeddedFile::path
or EmbeddedGlob::pattern
, depending on the
type of this entry.
sourcepub fn as_glob(&self) -> Option<&EmbeddedGlob>
pub fn as_glob(&self) -> Option<&EmbeddedGlob>
Returns Some(_)
if this entry is an embedded glob, None
otherwise.
sourcepub fn as_file(&self) -> Option<&EmbeddedFile>
pub fn as_file(&self) -> Option<&EmbeddedFile>
Returns Some(_)
if this entry is an embedded single file, None
otherwise.
sourcepub fn files(&self) -> impl Iterator<Item = &EmbeddedFile>
pub fn files(&self) -> impl Iterator<Item = &EmbeddedFile>
Returns the files in this entry. If it’s a single file, the returned
iterator contains one item, otherwise it’s like EmbeddedGlob::files
.