Struct winsafe::LOGPALETTE
source · #[repr(C)]pub struct LOGPALETTE {
pub palVersion: u16,
/* private fields */
}
Available on crate feature
gdi
only.Expand description
LOGPALETTE
struct.
§Examples
use winsafe::{self as w, prelude::*};
let mut log_pal = w::LOGPALETTE::new(0x300, &[
w::PALETTEENTRY { peRed: 1, peGreen: 2, peBlue: 3, ..Default::default() },
w::PALETTEENTRY { peRed: 10, peGreen: 20, peBlue: 30, ..Default::default() },
])?;
// Setting a new entry value
log_pal.palPalEntry_mut()[0].peRed = 255;
// Printing all entry values
for entry in log_pal.palPalEntry().iter() {
println!("{} {} {}", entry.peRed, entry.peGreen, entry.peBlue);
}
Fields§
§palVersion: u16
Implementations§
source§impl LOGPALETTE
impl LOGPALETTE
sourcepub fn new(
palVersion: u16,
entries: &[PALETTEENTRY]
) -> SysResult<LogpaletteGuard>
pub fn new( palVersion: u16, entries: &[PALETTEENTRY] ) -> SysResult<LogpaletteGuard>
Returns a dynamically allocated
LogpaletteGuard
.
sourcepub const fn palPalEntry(&self) -> &[PALETTEENTRY]
pub const fn palPalEntry(&self) -> &[PALETTEENTRY]
Returns a constant slice over the palPalEntry
entries.
sourcepub fn palPalEntry_mut(&mut self) -> &mut [PALETTEENTRY]
pub fn palPalEntry_mut(&mut self) -> &mut [PALETTEENTRY]
Returns a mutable slice over the palPalEntry
entries.
Trait Implementations§
impl VariableSized for LOGPALETTE
Auto Trait Implementations§
impl Freeze for LOGPALETTE
impl RefUnwindSafe for LOGPALETTE
impl Send for LOGPALETTE
impl Sync for LOGPALETTE
impl Unpin for LOGPALETTE
impl UnwindSafe for LOGPALETTE
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