pub struct DataSourceContext { /* private fields */ }Expand description
DataSourceContext — per-instance configuration passed via createWithContext. Mirrors graph-ts DataSourceContext: typed key-value store.
Implementations§
Source§impl DataSourceContext
impl DataSourceContext
Sourcepub fn new(fields: HashMap<String, Value>) -> Self
pub fn new(fields: HashMap<String, Value>) -> Self
Create a context from an existing field map (for runtime population).
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Raw getter — returns Option for presence checks.
Sourcepub fn get_string(&self, key: &str) -> String
pub fn get_string(&self, key: &str) -> String
Typed getter — panics if key absent (matches graph-ts behavior).
pub fn get_bytes(&self, key: &str) -> Vec<u8> ⓘ
pub fn get_big_int(&self, key: &str) -> BigInt
pub fn get_i32(&self, key: &str) -> i32
pub fn get_boolean(&self, key: &str) -> bool
Sourcepub fn set_string(&mut self, key: &str, value: impl Into<String>)
pub fn set_string(&mut self, key: &str, value: impl Into<String>)
Typed setters — for constructing context before createWithContext.
pub fn set_bytes(&mut self, key: &str, value: Vec<u8>)
pub fn set_big_int(&mut self, key: &str, value: BigInt)
pub fn set_i32(&mut self, key: &str, value: i32)
pub fn set_boolean(&mut self, key: &str, value: bool)
Sourcepub fn into_fields(self) -> HashMap<String, Value>
pub fn into_fields(self) -> HashMap<String, Value>
Access the underlying fields (for runtime conversion).
Trait Implementations§
Source§impl Clone for DataSourceContext
impl Clone for DataSourceContext
Source§fn clone(&self) -> DataSourceContext
fn clone(&self) -> DataSourceContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DataSourceContext
impl RefUnwindSafe for DataSourceContext
impl Send for DataSourceContext
impl Sync for DataSourceContext
impl Unpin for DataSourceContext
impl UnsafeUnpin for DataSourceContext
impl UnwindSafe for DataSourceContext
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
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 more