pub struct GivenRows {
pub header: Arc<GivenRowsHeader>,
/* private fields */
}Expand description
Rows of data to be used as input to a TypeQL query using a given stage.
§Examples
let query = "given $n: string, $a: integer; insert $p isa person, has name == $n, has age == $a;";
let mut rows = GivenRows::new(vec!["n".to_owned(), "a".to_owned()], 1);
rows.push_row(vec![GivenRowEntry::Value(Value::String("Alice".to_owned())), GivenRowEntry::Value(Value::Integer(28))]);
rows.push_row(vec!["Bob".into(), 26.into()]);
transaction.query_with_rows(query, rows)Fields§
§header: Arc<GivenRowsHeader>Implementations§
Source§impl GivenRows
impl GivenRows
pub fn new(variables: Vec<String>, row_count_hint: usize) -> Self
pub fn new_with_headers( header: Arc<GivenRowsHeader>, row_count_hint: usize, ) -> Self
pub fn into_parts(self) -> (Arc<GivenRowsHeader>, Vec<Vec<GivenRowEntry>>)
pub fn push(&mut self, row: GivenRow) -> Result
pub fn push_row(&mut self, row: Vec<GivenRowEntry>) -> Result
pub fn push_map( &mut self, values: impl IntoIterator<Item = (String, GivenRowEntry)>, ) -> Result
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GivenRows
impl RefUnwindSafe for GivenRows
impl Send for GivenRows
impl Sync for GivenRows
impl Unpin for GivenRows
impl UnsafeUnpin for GivenRows
impl UnwindSafe for GivenRows
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
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> 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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request