Struct mz_repr::VersionedRelationDesc
source · 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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
.