pub struct CellAttrs(/* private fields */);Expand description
Packed cell attributes:
- bits 31..24:
StyleFlags(8 bits) - bits 23..0:
link_id(24 bits)
Implementations§
Source§impl CellAttrs
impl CellAttrs
Sourcepub const LINK_ID_NONE: u32 = 0
pub const LINK_ID_NONE: u32 = 0
Sentinel value for “no hyperlink”.
Sourcepub const LINK_ID_MAX: u32 = 0x00FF_FFFF
pub const LINK_ID_MAX: u32 = 0x00FF_FFFF
Maximum link ID (24-bit range).
Matches LinkRegistry’s MAX_LINK_ID: the registry allocates ids up
to and including 0x00FF_FFFF (0 is the only sentinel), so the full
24-bit range minus zero is valid here. The previous 0x00FF_FFFE
value debug-panicked on the registry’s last legitimately allocated
id while release builds accepted it — a profile-divergent contract.
Sourcepub fn new(flags: StyleFlags, link_id: u32) -> Self
pub fn new(flags: StyleFlags, link_id: u32) -> Self
Create attributes from flags and a hyperlink ID.
Sourcepub fn flags(self) -> StyleFlags
pub fn flags(self) -> StyleFlags
Extract the style flags.
Sourcepub fn with_flags(self, flags: StyleFlags) -> Self
pub fn with_flags(self, flags: StyleFlags) -> Self
Return a copy with different style flags.
Sourcepub fn merged_flags(self, extra: StyleFlags) -> Self
pub fn merged_flags(self, extra: StyleFlags) -> Self
Return a copy with additional style flags OR-ed in (preserving existing flags and link ID).
Unlike with_flags which replaces all flags, this method
merges the new flags on top so that existing attributes are preserved.
Sourcepub fn has_flag(self, flag: StyleFlags) -> bool
pub fn has_flag(self, flag: StyleFlags) -> bool
Check whether a specific flag is set.