pub struct NativeStorage { /* private fields */ }Implementations§
Source§impl NativeStorage
impl NativeStorage
pub async fn open(db_url: &str) -> Result<Self, PortError>
pub async fn execute_raw(&self, sql: &'static str) -> Result<(), PortError>
pub fn with_metric_sink(self, metrics: Arc<dyn AsyncMetricSink>) -> Self
Trait Implementations§
Source§impl Clone for NativeStorage
impl Clone for NativeStorage
Source§fn clone(&self) -> NativeStorage
fn clone(&self) -> NativeStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Storage for NativeStorage
impl Storage for NativeStorage
Source§fn scoped_guarded_bump<'life0, 'async_trait>(
&'life0 self,
spec: ScopedGuardedBumpSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scoped_guarded_bump<'life0, 'async_trait>(
&'life0 self,
spec: ScopedGuardedBumpSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
将复合作用域守卫更新委托给共享 HostStorage。
Source§fn scoped_get<'life0, 'async_trait>(
&'life0 self,
spec: ScopedGetSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scoped_get<'life0, 'async_trait>(
&'life0 self,
spec: ScopedGetSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
将复合作用域读取委托给共享 HostStorage。
Source§fn scoped_max<'life0, 'async_trait>(
&'life0 self,
spec: ScopedMaxSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scoped_max<'life0, 'async_trait>(
&'life0 self,
spec: ScopedMaxSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
将作用域集合最大值读取委托给共享 HostStorage。
Source§fn scoped_scan<'life0, 'async_trait>(
&'life0 self,
spec: ScopedScanSpec,
) -> Pin<Box<dyn Future<Output = Result<Vec<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scoped_scan<'life0, 'async_trait>(
&'life0 self,
spec: ScopedScanSpec,
) -> Pin<Box<dyn Future<Output = Result<Vec<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
将作用域集合有界多行读取委托给共享 HostStorage。
Source§fn batch_upsert<'life0, 'async_trait>(
&'life0 self,
spec: UpsertSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_upsert<'life0, 'async_trait>(
&'life0 self,
spec: UpsertSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
batch upsert:整批一事务 INSERT,按
conflict_key 解决唯一冲突(B6 语义真源)。 Read moreSource§fn batch_update<'life0, 'async_trait>(
&'life0 self,
spec: BatchUpdateSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_update<'life0, 'async_trait>(
&'life0 self,
spec: BatchUpdateSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
batch update:UPDATE table SET patch WHERE key_col IN (key_vals) Read more
Source§fn monotonic_upsert<'life0, 'async_trait>(
&'life0 self,
spec: MonotonicUpsertSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn monotonic_upsert<'life0, 'async_trait>(
&'life0 self,
spec: MonotonicUpsertSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
通用单调 MAX-guard 写:仅在 new value > 当前值时才写入(CAS / 单调寄存器语义)。 Read more
Source§fn guarded_bump<'life0, 'async_trait>(
&'life0 self,
spec: GuardedBumpSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn guarded_bump<'life0, 'async_trait>(
&'life0 self,
spec: GuardedBumpSpec,
) -> Pin<Box<dyn Future<Output = Result<(), PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
守卫式自增:
UPDATE … SET bump_col = bump_col + delta[, set…] WHERE key=? AND ? > guard_col。 Read moreSource§fn get<'life0, 'async_trait>(
&'life0 self,
spec: GetSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
spec: GetSpec,
) -> Pin<Box<dyn Future<Output = Result<Option<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get:单行查询
Source§fn scan<'life0, 'async_trait>(
&'life0 self,
spec: ScanSpec,
) -> Pin<Box<dyn Future<Output = Result<Vec<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scan<'life0, 'async_trait>(
&'life0 self,
spec: ScanSpec,
) -> Pin<Box<dyn Future<Output = Result<Vec<HelixRow>, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
scan:多行扫描读(评审待办 C3)。
limit = None 表示全表,driver 应设硬上限防御。 Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NativeStorage
impl !UnwindSafe for NativeStorage
impl Freeze for NativeStorage
impl Send for NativeStorage
impl Sync for NativeStorage
impl Unpin for NativeStorage
impl UnsafeUnpin for NativeStorage
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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