sql_parse

Trait OptSpanned

Source
pub trait OptSpanned {
    // Required method
    fn opt_span(&self) -> Option<Span>;

    // Provided method
    fn opt_join_span(&self, other: &impl OptSpanned) -> Option<Span> { ... }
}
Expand description

Compute an optional byte span of an ast fragment

Required Methods§

Source

fn opt_span(&self) -> Option<Span>

Compute an optional byte span of an ast fragment

Provided Methods§

Source

fn opt_join_span(&self, other: &impl OptSpanned) -> Option<Span>

Compute the minimal span containing both self and other if either is missing return the other

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: OptSpanned> OptSpanned for Option<T>

Source§

impl<T: OptSpanned> OptSpanned for [T]

Source§

impl<T: OptSpanned> OptSpanned for Vec<T>

Implementors§