pub struct Icon { /* private fields */ }Expand description
An icon used for the window titlebar, taskbar, etc.
Enabling the icon_loading feature provides you with several convenience methods for creating
an Icon from any format supported by the image
crate.
Implementations§
source§impl Icon
impl Icon
sourcepub fn from_rgba(
rgba: Vec<u8, Global>,
width: u32,
height: u32
) -> Result<Icon, BadIcon>
pub fn from_rgba( rgba: Vec<u8, Global>, width: u32, height: u32 ) -> Result<Icon, BadIcon>
Creates an Icon from 32bpp RGBA data.
The length of rgba must be divisible by 4, and width * height must equal
rgba.len() / 4. Otherwise, this will return a BadIcon error.
sourcepub fn from_path<P>(path: P) -> Result<Icon, ImageError>where
P: AsRef<Path>,
pub fn from_path<P>(path: P) -> Result<Icon, ImageError>where P: AsRef<Path>,
Loads an Icon from the path of an image on the filesystem.
Requires the icon_loading feature.
sourcepub fn from_reader<R>(
reader: R,
format: ImageFormat
) -> Result<Icon, ImageError>where
R: BufRead + Seek,
pub fn from_reader<R>( reader: R, format: ImageFormat ) -> Result<Icon, ImageError>where R: BufRead + Seek,
Loads an Icon from anything implementing BufRead and Seek.
Requires the icon_loading feature.
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Icon, ImageError>
pub fn from_bytes(bytes: &[u8]) -> Result<Icon, ImageError>
Loads an Icon from the unprocessed bytes of an image file.
Uses heuristics to determine format.
Requires the icon_loading feature.
sourcepub fn from_bytes_with_format(
bytes: &[u8],
format: ImageFormat
) -> Result<Icon, ImageError>
pub fn from_bytes_with_format( bytes: &[u8], format: ImageFormat ) -> Result<Icon, ImageError>
Loads an Icon from the unprocessed bytes of an image.
Requires the icon_loading feature.
Trait Implementations§
source§impl PartialEq<Icon> for Icon
impl PartialEq<Icon> for Icon
impl Eq for Icon
impl StructuralEq for Icon
impl StructuralPartialEq for Icon
Auto Trait Implementations§
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnwindSafe for Icon
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.