pub struct VersionedRelationDesc {
inner: RelationDesc,
}
Expand description
A wrapper around RelationDesc
that provides an interface for adding
columns and generating new versions.
TODO(parkmycar): Using an immutable data structure for RelationDesc would be great.
Fields§
§inner: RelationDesc
Implementations§
Source§impl VersionedRelationDesc
impl VersionedRelationDesc
pub fn new(inner: RelationDesc) -> Self
Sourcepub fn add_column<N, T>(&mut self, name: N, typ: T) -> RelationVersion
pub fn add_column<N, T>(&mut self, name: N, typ: T) -> RelationVersion
Adds a new column to this RelationDesc
, creating a new version of the RelationDesc
.
§Panics
- Panics if a column with
name
already exists that hasn’t been dropped.
Note: For building a RelationDesc
see RelationDescBuilder::with_column
.
Sourcepub fn drop_column<N>(&mut self, name: N) -> RelationVersionwhere
N: Into<ColumnName>,
pub fn drop_column<N>(&mut self, name: N) -> RelationVersionwhere
N: Into<ColumnName>,
Drops the column name
from this RelationDesc
. If there are multiple columns with
name
drops the left-most one that hasn’t already been dropped.
TODO(parkmycar): Add handling for dropping a column that is currently used as a key.
§Panics
Panics if a column with name
does not exist or the dropped column was used as a key.
Sourcepub fn latest(&self) -> RelationDesc
pub fn latest(&self) -> RelationDesc
Returns the RelationDesc
at the latest version.
Sourcepub fn at_version(&self, version: RelationVersionSelector) -> RelationDesc
pub fn at_version(&self, version: RelationVersionSelector) -> RelationDesc
Returns this RelationDesc
at the specified version.
pub fn latest_version(&self) -> RelationVersion
Sourcefn validate(&self)
fn validate(&self)
Validates internal contraints of the RelationDesc
are correct.
§Panics
Panics if a constraint is not satisfied.
Trait Implementations§
Source§impl Clone for VersionedRelationDesc
impl Clone for VersionedRelationDesc
Source§fn clone(&self) -> VersionedRelationDesc
fn clone(&self) -> VersionedRelationDesc
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for VersionedRelationDesc
impl Debug for VersionedRelationDesc
Auto Trait Implementations§
impl Freeze for VersionedRelationDesc
impl RefUnwindSafe for VersionedRelationDesc
impl Send for VersionedRelationDesc
impl Sync for VersionedRelationDesc
impl Unpin for VersionedRelationDesc
impl UnwindSafe for VersionedRelationDesc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
T
in a tonic::Request
Source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.