pub struct File<'a> {
pub name: &'a str,
/* private fields */
}
Expand description
A struct representing a file you wish to get the associated icon for.
You can create a File
struct from anything that can be converted to a Path
.
§Example
use devicons::File;
let path = std::path::Path::new("Cargo.toml");
let file = File::new(path);
You can also use the From
trait to convert a Path
to a File
:
use devicons::File;
use std::path::Path;
let path = Path::new("Cargo.toml");
let file: File = path.into();
See more examples in the examples
directory.
Fields§
§name: &'a str
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for File<'a>
impl<'a> RefUnwindSafe for File<'a>
impl<'a> Send for File<'a>
impl<'a> Sync for File<'a>
impl<'a> Unpin for File<'a>
impl<'a> UnwindSafe for File<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more