pub struct ChunkOptionEntry { /* private fields */ }Expand description
A single chunk option, decoupled from its source CST shape. Inline
options come from CHUNK_OPTION nodes on the fence info line; hashpipe
options come from the embedded YAML block map under
HASHPIPE_YAML_CONTENT. Both project to the same key/value/range view so
CodeBlock::merged_chunk_option_entries can mix them.
Implementations§
Source§impl ChunkOptionEntry
impl ChunkOptionEntry
pub fn new( key: Option<String>, value: Option<String>, key_range: Option<TextRange>, value_range: Option<TextRange>, is_quoted: bool, declaration_range: TextRange, source: ChunkOptionSource, ) -> Self
Sourcepub fn from_inline_option(
option: &ChunkOption,
source: ChunkOptionSource,
) -> Self
pub fn from_inline_option( option: &ChunkOption, source: ChunkOptionSource, ) -> Self
Build an entry from an inline CHUNK_OPTION node (fence info line).
pub fn source(&self) -> ChunkOptionSource
pub fn key(&self) -> Option<String>
pub fn key_range(&self) -> Option<TextRange>
pub fn value(&self) -> Option<String>
pub fn value_range(&self) -> Option<TextRange>
pub fn is_quoted(&self) -> bool
Sourcepub fn declaration_range(&self) -> TextRange
pub fn declaration_range(&self) -> TextRange
The full source range of the option declaration (the CHUNK_OPTION
node for inline options, the YAML_BLOCK_MAP_ENTRY for hashpipe).
Trait Implementations§
Source§impl Clone for ChunkOptionEntry
impl Clone for ChunkOptionEntry
Source§fn clone(&self) -> ChunkOptionEntry
fn clone(&self) -> ChunkOptionEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChunkOptionEntry
impl Debug for ChunkOptionEntry
impl Eq for ChunkOptionEntry
Source§impl Hash for ChunkOptionEntry
impl Hash for ChunkOptionEntry
Source§impl PartialEq for ChunkOptionEntry
impl PartialEq for ChunkOptionEntry
Source§fn eq(&self, other: &ChunkOptionEntry) -> bool
fn eq(&self, other: &ChunkOptionEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ChunkOptionEntry
Auto Trait Implementations§
impl Freeze for ChunkOptionEntry
impl RefUnwindSafe for ChunkOptionEntry
impl Send for ChunkOptionEntry
impl Sync for ChunkOptionEntry
impl Unpin for ChunkOptionEntry
impl UnsafeUnpin for ChunkOptionEntry
impl UnwindSafe for ChunkOptionEntry
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