W3cubDocs

/Rust

Keyword super

The parent of the current module.

mod a {
    pub fn foo() {}
}
mod b {
    pub fn foo() {
        super::a::foo(); // call a's foo function
    }
}

It is also possible to use super multiple times: super::super::foo, going up the ancestor chain.

See the Reference for more information.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/keyword.super.html