Expand description
RowArena
is used to hold on to temporary Row
s for functions like eval
that need to create complex Datum
s but don’t have a Row
to put them in yet.
Fields
inner: RefCell<Vec<Vec<u8>>>
Implementations
sourceimpl RowArena
impl RowArena
pub fn new() -> Self
sourcepub fn push_bytes<'a>(&'a self, bytes: Vec<u8>) -> &'a [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
pub fn push_bytes<'a>(&'a self, bytes: Vec<u8>) -> &'a [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Take ownership of bytes
for the lifetime of the arena.
sourcepub fn push_string<'a>(&'a self, string: String) -> &'a str
pub fn push_string<'a>(&'a self, string: String) -> &'a str
Take ownership of string
for the lifetime of the arena.
sourcepub fn push_unary_row<'a>(&'a self, row: Row) -> Datum<'a>
pub fn push_unary_row<'a>(&'a self, row: Row) -> Datum<'a>
Take ownership of row
for the lifetime of the arena, returning a
reference to the first datum in the row.
If we had an owned datum type, this method would be much clearer, and
would be called push_owned_datum
.
sourcepub fn make_datum<'a, F>(&'a self, f: F) -> Datum<'a> where
F: FnOnce(&mut RowPacker<'_>),
pub fn make_datum<'a, F>(&'a self, f: F) -> Datum<'a> where
F: FnOnce(&mut RowPacker<'_>),
Convenience function to make a new Row
containing a single datum, and
take ownership of it for the lifetime of the arena
let arena = RowArena::new();
let datum = arena.make_datum(|packer| {
packer.push_list(&[Datum::String("hello"), Datum::String("world")]);
});
assert_eq!(datum.unwrap_list().iter().collect::<Vec<_>>(), vec![Datum::String("hello"), Datum::String("world")]);
sourcepub fn try_make_datum<'a, F, E>(&'a self, f: F) -> Result<Datum<'a>, E> where
F: FnOnce(&mut RowPacker<'_>) -> Result<(), E>,
pub fn try_make_datum<'a, F, E>(&'a self, f: F) -> Result<Datum<'a>, E> where
F: FnOnce(&mut RowPacker<'_>) -> Result<(), E>,
Like RowArena::make_datum
, but the provided closure can return an error.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RowArena
impl Send for RowArena
impl !Sync for RowArena
impl Unpin for RowArena
impl UnwindSafe for RowArena
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more