visibility_to_str

Function visibility_to_str 

Source
pub fn visibility_to_str(visibility: &Visibility) -> &'static str
Expand description

Convert the visibility to a string.

§Arguments

  • visibility - The visibility

§Returns

The string representation of the visibility.

§Example

let visibility = Visibility::Public;
let str = visibility_to_str(visibility);
assert_eq!(str, "public");