pub struct Session { /* private fields */ }Expand description
The explore session of one drawing. See the module.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(base: GraphResult) -> Session
pub fn new(base: GraphResult) -> Session
A session on what .graph drew.
Sourcepub fn result(&self) -> &GraphResult
pub fn result(&self) -> &GraphResult
The graph as it stands: the base with every applied step.
Sourcepub fn steps(&self) -> &[Step]
pub fn steps(&self) -> &[Step]
Every step, the undone ones included: steps()[..applied()] are in
the graph.
Sourcepub async fn not_shown(
&mut self,
ctx: &SessionContext,
sql: &dyn RunSql,
) -> Result<Vec<u32>>
pub async fn not_shown( &mut self, ctx: &SessionContext, sql: &dyn RunSql, ) -> Result<Vec<u32>>
The node id names: of the first label that has the key.
For each node slot, how many of the node’s edges in the property
graph lead to something that is not shown: its degree in the graph
(both directions, every edge counted, as degree counts) less its
shown edges here. It is what a view’s +N badge says, and 0 for a
hidden node and for one the graph does not have. Empty when the
drawing is not of a property graph.
The graph’s degrees are read once for each node (one degree query
for the nodes not asked about before: by key for up to
[DEGREES_BY_KEY] of them, else the whole graph’s), and the shown
edges are counted each time.
Sourcepub async fn run(
&mut self,
ctx: &SessionContext,
sql: &dyn RunSql,
line: &str,
) -> Result<Outcome>
pub async fn run( &mut self, ctx: &SessionContext, sql: &dyn RunSql, line: &str, ) -> Result<Outcome>
Run one command: .expand, .hide, .show, .undo, .redo or
.graph history, as Command::parse reads it. sql runs the
statements of .expand on ctx.
An error (a line that is not a command, an id that is not a node, SQL that failed) changes nothing.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
Blanket Implementations§
impl<T> Allocation for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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