pub struct Assets;
Expand description
Assets from swagger-ui-dist
Implementations§
Source§impl Assets
impl Assets
pub fn get(file_path: &str) -> Option<Cow<'static, [u8]>>
Sourcepub fn iter() -> impl Iterator<Item = Cow<'static, str>>
pub fn iter() -> impl Iterator<Item = Cow<'static, str>>
Examples found in repository?
examples/basic.rs (line 6)
3fn main() {
4 println!("swagger-ui bundles files:");
5 // Use Assets::iter() to get iterator of all filenames
6 for file in Assets::iter() {
7 let filename = file.as_ref();
8 println!("\t{}", filename);
9 // `Assets::get(filename)` returns file content
10 };
11
12 // Load openapi spec (compile-time)
13 let _spec: Spec = swagger_spec_file!("./openapi.json");
14
15 // swagger-ui configuration struct
16 let _config: Config = Config {
17 url: "".to_string(),
18 urls: vec![],
19 deep_linking: false,
20 display_operation_id: false,
21 default_models_expand_depth: 0,
22 default_model_expand_depth: 0,
23 default_model_rendering: DefaultModelRendering::Example,
24 display_request_duration: false,
25 doc_expansion: DocExpansion::List,
26 filter: Filter::Bool(false),
27 max_displayed_tags: 0,
28 show_extensions: false,
29 show_common_extensions: false
30 };
31}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Assets
impl RefUnwindSafe for Assets
impl Send for Assets
impl Sync for Assets
impl Unpin for Assets
impl UnwindSafe for Assets
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more