pub struct Outcome {
pub command: String,
pub columns: Vec<Column>,
pub rows: Vec<Vec<Json>>,
pub total: usize,
pub more: bool,
pub changes: i64,
pub last_insert_rowid: i64,
pub elapsed_ms: f64,
pub text: String,
pub extra: Vec<(String, Json)>,
}Expand description
What a command produced.
Fields§
§command: StringThe verb that ran.
columns: Vec<Column>The result columns, empty for a command that produces no table.
rows: Vec<Vec<Json>>The rows, already cut to whatever limit was asked for.
total: usizeHow many rows the statement produced before the limit.
more: boolWhether the limit cut anything off.
changes: i64How many rows the statement changed.
last_insert_rowid: i64The rowid the last insert assigned.
elapsed_ms: f64How long it took.
text: StringThe rendering a person reads.
extra: Vec<(String, Json)>Anything this particular command has to say that the shape above cannot.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn said(command: &str, text: impl Into<String>) -> Outcome
pub fn said(command: &str, text: impl Into<String>) -> Outcome
Builds an outcome that is only a message.
@param command - the verb @param text - what to show
Sourcepub fn with(self, name: &str, value: Json) -> Outcome
pub fn with(self, name: &str, value: Json) -> Outcome
Adds a field only this command has.
@param name - the member name @param value - what to put under it
Sourcepub fn with_recovery(self, recovery: &Recovery, strays: &[u64]) -> Outcome
pub fn with_recovery(self, recovery: &Recovery, strays: &[u64]) -> Outcome
Adds what opening the database did, when it did anything.
Only when something happened (task-1979, C10). A recovered member
on every result of every command would change the envelope every caller
parses and every page documents, to carry false almost always. An
operator investigating a crash asks one question - was this file
recovered - and the answer is the presence of the member.
A stray segment is reported the same way and for the same reason: it is a file beside the database that nothing will replay and nothing will remove, so naming it is the only way anybody finds out it is there.
@param recovery - what the open reported @param strays - segments beside the file the chain does not reach
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnsafeUnpin for Outcome
impl UnwindSafe for Outcome
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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