1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
910use mz_proto::{RustType, TryFromProtoError};
11use timely::progress::Antichain;
1213use crate::Timestamp;
1415include!(concat!(env!("OUT_DIR"), "/mz_repr.antichain.rs"));
1617impl RustType<ProtoU64Antichain> for Antichain<Timestamp> {
18fn into_proto(&self) -> ProtoU64Antichain {
19 ProtoU64Antichain {
20 elements: self.elements().iter().map(Into::into).collect(),
21 }
22 }
2324fn from_proto(proto: ProtoU64Antichain) -> Result<Self, TryFromProtoError> {
25Ok(Antichain::from_iter(
26 proto.elements.into_iter().map(Timestamp::from),
27 ))
28 }
29}