pub struct ViewConfig {
pub max_tokens: usize,
pub expansion_depth: usize,
pub include_docs: bool,
pub include_types: bool,
pub format: ViewFormat,
pub add_separators: bool,
pub sort_by_type: bool,
pub deduplicate: bool,
}Expand description
Configuration for creating virtual views
Fields§
§max_tokens: usizeMaximum tokens to include
expansion_depth: usizeDepth of automatic dependency expansion (Ghost Imports)
include_docs: boolInclude doc comments
include_types: boolInclude type definitions for referenced types
format: ViewFormatFormat for the view output
add_separators: boolAdd separator comments between atoms
sort_by_type: boolSort atoms by type (imports first, then types, then functions)
deduplicate: boolDeduplicate atoms that appear multiple times
Implementations§
Source§impl ViewConfig
impl ViewConfig
Sourcepub fn documented() -> Self
pub fn documented() -> Self
Create a config for documentation purposes
Sourcepub fn with_max_tokens(self, tokens: usize) -> Self
pub fn with_max_tokens(self, tokens: usize) -> Self
Set maximum tokens
Sourcepub fn with_expansion(self, depth: usize) -> Self
pub fn with_expansion(self, depth: usize) -> Self
Set expansion depth
Sourcepub fn no_expansion(self) -> Self
pub fn no_expansion(self) -> Self
Disable Ghost Imports
Trait Implementations§
Source§impl Clone for ViewConfig
impl Clone for ViewConfig
Source§fn clone(&self) -> ViewConfig
fn clone(&self) -> ViewConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 ViewConfig
impl Debug for ViewConfig
Source§impl Default for ViewConfig
impl Default for ViewConfig
Source§impl<'de> Deserialize<'de> for ViewConfig
impl<'de> Deserialize<'de> for ViewConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ViewConfig
impl RefUnwindSafe for ViewConfig
impl Send for ViewConfig
impl Sync for ViewConfig
impl Unpin for ViewConfig
impl UnwindSafe for ViewConfig
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