pub struct ProjectOptions {
pub spans: bool,
pub payloads: bool,
pub source_maps: bool,
}Expand description
The options of a projection: what it shows beyond the structure it always shows.
The three switches are independent. By default spans and source maps are
hidden and presentation payloads are shown. Build the options with
new and the builder methods, then pass them to
Projector::new or to one of the free functions of this module.
Fields§
§spans: boolWhether every node shows its span as line:col (key "span"); off by
default.
payloads: boolWhether presentation nodes show their payload (key "payload"); on by
default.
source_maps: boolWhether text runs show their text source map, when they carry one (key
"map"); off by default.
Implementations§
Source§impl ProjectOptions
impl ProjectOptions
Sourcepub fn new() -> ProjectOptions
pub fn new() -> ProjectOptions
Returns the default options: no spans, payloads shown, no source maps.
Sourcepub fn with_spans(self) -> ProjectOptions
pub fn with_spans(self) -> ProjectOptions
Builder: shows the span of every node.
Sourcepub fn without_payloads(self) -> ProjectOptions
pub fn without_payloads(self) -> ProjectOptions
Builder: hides the payloads of presentation nodes.
Sourcepub fn with_source_maps(self) -> ProjectOptions
pub fn with_source_maps(self) -> ProjectOptions
Builder: shows the text source maps of text runs.
Trait Implementations§
Source§impl Clone for ProjectOptions
impl Clone for ProjectOptions
impl Copy for ProjectOptions
Source§impl Debug for ProjectOptions
impl Debug for ProjectOptions
Source§impl Default for ProjectOptions
impl Default for ProjectOptions
Source§fn default() -> ProjectOptions
fn default() -> ProjectOptions
impl Eq for ProjectOptions
Source§impl PartialEq for ProjectOptions
impl PartialEq for ProjectOptions
impl StructuralPartialEq for ProjectOptions
Auto Trait Implementations§
impl Forget for ProjectOptions
impl Freeze for ProjectOptions
impl Move for ProjectOptions
impl RefUnwindSafe for ProjectOptions
impl Send for ProjectOptions
impl Sync for ProjectOptions
impl Unpin for ProjectOptions
impl UnsafeUnpin for ProjectOptions
impl UnwindSafe for ProjectOptions
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more