You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: authz.rs
    path of file: ./repos/linkerd2-proxy/linkerd/proxy/server-policy/src
    
    the code of the file until where you have to start completion: use super::Meta;
use std::{collections::BTreeSet, sync::Arc};

mod network;

pub use self::network::Network;

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Authorization {
    
        fn try_from(proto: api::Authz) -> Result<Self, Self::Error> {
            let api::Authz {
                labels,
                authentication,
                networks,
                metadata,
            } = proto;

            if networks.is_empty() {
                return Err(InvalidAuthz::MissingNetworks);
            }
            let networks = networks
                .into_iter()
                .map(|api::Network { net, except }| {
                    let net = net.ok_or(InvalidAuthz::MissingNetwork)?.try_into()?;
                    let except = except
                        .into_iter()
                        .map(|net| net.try_into())
                        .collect::<Result<Vec<_>, _>>()?;
                    Ok(Network { net, except })
                })
                .collect::<Result<Vec<_>, InvalidAuthz>>()?;

            let authn = {
                let api::Authn { permit } =
                    authentication.ok_or(InvalidAuthz::MissingAuthentications)?;
                match permit.ok_or(InvalidAuthz::MissingAuthentications)? {
                    api::authn::Permit::Unauthenticated(_) => Authentication::Unauthenticated,
                    api::authn::Permit::MeshTls(api::authn::PermitMeshTls { clients }) => {
                        match clients.ok_or(InvalidAuthz::MissingAuthentications)? {
                            api::authn::permit_mesh_tls::Clients::Unauthenticated(_) => {
                                Authentication::TlsUnauthenticated
                            }
                            api::authn::permit_mesh_tls::Clients::Identities(ids) => {
                                let identities = ids
                                    .identities
                                    .into_iter()
                                    .map(|api::Identity { name }| name)
                                    .collect();
                                let suffixes = ids
                                    .suffixes
                                    .into_iter()
                                    .map(|api::IdentitySuffix { parts }| Suffix::from(parts))
                                    .collect();
                                Authentication::TlsAuthenticated {
                                    identities,
                                    suffixes,
                                }
                            }
                        }
                    }
                }
            };

            // If the response includes `metadata`, use it; otherwise fall-back
            // to using old-style labels.
            let meta = match metadata {
                Some(m) => Arc::new(m.try_into()?),
                None => {
                    Meta::try_new_with_default(labels, "policy.linkerd.io", "serverauthorization")?
                }
            };

            Ok(Authorization {
                networks,
                authentication: authn,
                meta,
            })
        }