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: outline.rs
    path of file: ./repos/typst/crates/typst/src/model
    
    the code of the file until where you have to start completion: use std::num::NonZeroUsize;
use std::str::FromStr;

use crate::diag::{bail, At, SourceResult};
use crate::engine::Engine;
use crate::foundations::{
    cast, elem, scope, select_where, Content, Context, Func, LocatableSelector,
    NativeElement, Packed, Show, ShowSet, Smart, StyleChain, Styles,
};
use crate::introspection::{Counter, CounterKey, Locatable};
use crate::layout::{BoxElem, Fr, HElem, HideElem, Length, Rel, RepeatElem, Spacing};
use crate::model::{Destination, HeadingElem, NumberingPattern, ParbreakElem, Refable};
use crate::syntax::Span;
use crate::text::{Lang, LinebreakElem, LocalName, Region, SpaceElem, TextElem};
use crate::util::{option_eq, NonZeroExt};

/// A table of contents, figures, or other elements.
///
/// This function generates a list of all occurrences of an element in the
/// document, up to a given depth. The element's numbering and page number will
/// be displayed in the outline alongside its title or caption. By default this
/// generates a table of contents.
///
/// # Example
/// ```example
/// #outline()
///
/// = Introduction
/// #lorem(5)
///
/// = Prior work
/// #lorem(10)
/// ```
///
/// # Alternative out
    
    fn local_name(lang: Lang, region: Option<Region>) -> &'static str {
        match lang {
            Lang::ALBANIAN => "Përmbajtja",
            Lang::ARABIC => "المحتويات",
            Lang::BOKMÅL => "Innhold",
            Lang::CATALAN => "Índex",
            Lang::CHINESE if option_eq(region, "TW") => "目錄",
            Lang::CHINESE => "目录",
            Lang::CZECH => "Obsah",
            Lang::DANISH => "Indhold",
            Lang::DUTCH => "Inhoudsopgave",
            Lang::ESTONIAN => "Sisukord",
            Lang::FILIPINO => "Talaan ng mga Nilalaman",
            Lang::FINNISH => "Sisällys",
            Lang::FRENCH => "Table des matières",
            Lang::GERMAN => "Inhaltsverzeichnis",
            Lang::GREEK => "Περιεχόμενα",
            Lang::HUNGARIAN => "Tartalomjegyzék",
            Lang::ITALIAN => "Indice",
            Lang::NYNORSK => "Innhald",
            Lang::POLISH => "Spis treści",
            Lang::PORTUGUESE if option_eq(region, "PT") => "Índice",
            Lang::PORTUGUESE => "Sumário",
            Lang::ROMANIAN => "Cuprins",
            Lang::RUSSIAN => "Содержание",
            Lang::SERBIAN => "Садржај",
            Lang::SLOVENIAN => "Kazalo",
            Lang::SPANISH => "Índice",
            Lang::SWEDISH => "Innehåll",
            Lang::TURKISH => "İçindekiler",
            Lang::UKRAINIAN => "Зміст",
            Lang::VIETNAMESE => "Mục lục",
            Lang::JAPANESE => "目次",
            Lang::ENGLISH | _ => "Contents",
        }
    }