Construct a schema doc pre-populated with `schema`. The schema is encoded as MessagePack and stored under `root["content"]`. `generator.next()` is called to assign the initial `schema_hlc`.
(
replica_id: ReplicaId,
schema: &ArraySchema,
generator: &HlcGenerator,
)
| 62 | /// `root["content"]`. `generator.next()` is called to assign the initial |
| 63 | /// `schema_hlc`. |
| 64 | pub fn from_schema( |
| 65 | replica_id: ReplicaId, |
| 66 | schema: &ArraySchema, |
| 67 | generator: &HlcGenerator, |
| 68 | ) -> ArrayResult<Self> { |
| 69 | let mut doc_self = Self::new(replica_id); |
| 70 | doc_self.write_schema_to_doc(schema)?; |
| 71 | doc_self.schema_hlc = generator.next()?; |
| 72 | Ok(doc_self) |
| 73 | } |
| 74 | |
| 75 | /// Return the current schema HLC. |
| 76 | pub fn schema_hlc(&self) -> Hlc { |
nothing calls this directly
no test coverage detected