pub fn from_proto(proto: &proto::Meta) -> Self {
        if proto.version != CURRENT_VERSION {
            panic!(
                "Invalid version. We only support {}, but found {}.",
                CURRENT_VERSION, proto.version
            );
        }

        Meta {
            nodes: proto.nodes
                .iter()
                .map(|n| NodeId::new(n.level as u8, n.index))
                .collect(),
            bounding_rect: Rect::new(
                Point2::new(
                    proto.get_bounding_rect().get_min().x,
                    proto.get_bounding_rect().get_min().y,
                ),
                proto.get_bounding_rect().get_edge_length(),
            ),
            tile_size: proto.tile_size,
            deepest_level: proto.deepest_level as u8,
        }
    }
// Reads the meta from the provided encoded protobuf.
Reads the meta from the provided encoded protobuf.
Reads the meta from the provided encoded protobuf .
pub fn from_proto(proto: &proto::Meta) -> Self {
        if proto.version != CURRENT_VERSION {
            panic!(
                "Invalid version. We only support {}, but found {}.",
                CURRENT_VERSION, proto.version
            );
        }
        Meta {
            nodes: proto.nodes
                .iter()
                .map(|n| NodeId::new(n.level as u8, n.index))
                .collect(),
            bounding_rect: Rect::new(
                Point2::new(
                    proto.get_bounding_rect().get_min().x,
                    proto.get_bounding_rect().get_min().y,
                ),
                proto.get_bounding_rect().get_edge_length(),
            ),
            tile_size: proto.tile_size,
            deepest_level: proto.deepest_level as u8,
        }
    }
pub fn from_proto ( proto : & proto :: Meta ) -> Self { if proto . version != CURRENT_VERSION { panic ! ( " " CURRENT_VERSION proto version ) ; } Meta { nodes : proto . nodes . iter ( ) . map ( | n | NodeId :: new ( n . level as u8 , n . index ) ) . collect ( ) , bounding_rect : Rect :: new ( Point2 :: new ( proto . get_bounding_rect ( ) . get_min ( ) . x , proto . get_bounding_rect ( ) . get_min ( ) . y , ) , proto . get_bounding_rect ( ) . get_edge_length ( ) , ) , tile_size : proto . tile_size , deepest_level : proto . deepest_level as u8 , } }
Reads the meta from the provided encoded protobuf.
Reads the meta from the provided encoded protobuf .
proto
&proto::Meta
proto
&proto::Meta