pub struct SchemaSnapshot {
pub version: u32,
pub tables: Vec<TableSnapshot>,
}Expand description
스키마 스냅샷 — 리포에 커밋되는 검증 진실 소스 (명세 §7.1)
Fields§
§version: u32스키마 버전
tables: Vec<TableSnapshot>테이블 목록
Implementations§
Source§impl SchemaSnapshot
impl SchemaSnapshot
Sourcepub fn from_slice(bytes: &[u8]) -> Result<SchemaSnapshot, Error>
pub fn from_slice(bytes: &[u8]) -> Result<SchemaSnapshot, Error>
Parse a snapshot from raw JSON bytes (e.g. a decompressed embedded blob).
Sourcepub fn to_json(&self) -> Result<String, Error>
pub fn to_json(&self) -> Result<String, Error>
Serialize to the pretty JSON format used by snapshot files.
Sourcepub fn table(&self, name: &str) -> Option<&TableSnapshot>
pub fn table(&self, name: &str) -> Option<&TableSnapshot>
테이블 조회
Sourcepub fn canonical_string(&self) -> String
pub fn canonical_string(&self) -> String
정준 문자열 — 해시 입력. 테이블은 이름순 정렬, 컬럼은 선언 순서 유지.
각 가변 필드는 길이 접두사({len}:{값})로 인코딩해 필드 경계 충돌을
원천 차단한다 (L-14).
Trait Implementations§
Source§impl Clone for SchemaSnapshot
impl Clone for SchemaSnapshot
Source§fn clone(&self) -> SchemaSnapshot
fn clone(&self) -> SchemaSnapshot
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 Debug for SchemaSnapshot
impl Debug for SchemaSnapshot
Source§impl<'de> Deserialize<'de> for SchemaSnapshot
impl<'de> Deserialize<'de> for SchemaSnapshot
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchemaSnapshot, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SchemaSnapshot, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SchemaSnapshot
Source§impl PartialEq for SchemaSnapshot
impl PartialEq for SchemaSnapshot
Source§impl Serialize for SchemaSnapshot
impl Serialize for SchemaSnapshot
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SchemaSnapshot
Auto Trait Implementations§
impl Freeze for SchemaSnapshot
impl RefUnwindSafe for SchemaSnapshot
impl Send for SchemaSnapshot
impl Sync for SchemaSnapshot
impl Unpin for SchemaSnapshot
impl UnsafeUnpin for SchemaSnapshot
impl UnwindSafe for SchemaSnapshot
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