pub fn add_section(&mut self, name: Symbol, section: Section) -> Option<Section> {
        let name_as_str = name.as_str();
        assert!(
            name_as_str.len() <= 255,
            "section name must be shorter than 256 characters"
        );
        assert!(
            name_as_str.chars().all(|c| c.is_ascii_graphic()),
            "section name must not contain non-printable ASCII characters (less than `0x21` or greater than `0x7E`)"
        );
        assert!(
            self.sections.len() <= 255,
            "container file can only contain up to 255 sections"
        );
        self.sections.insert(name, section)
    }
/// Add a section to the container file. If there was already a section
/// with this name present, it will be replaced and returned.
///
/// # Panics
///
/// This function will panic if the name of the section was longer than 255
/// characters, if the name of the section contained non-printable ASCII
/// characters (less than `0x21` or greater than `0x7E`), or if there were
/// already 255 sections in the container file.
Add a section to the container file. If there was already a section
with this name present, it will be replaced and returned.
Add a section to the container file . If there was already a section with this name present it will be replaced and returned .
pub fn add_section(&mut self, name: Symbol, section: Section) -> Option<Section> {
        let name_as_str = name.as_str();
        assert!(
            name_as_str.len() <= 255,
            "section name must be shorter than 256 characters"
        );
        assert!(
            name_as_str.chars().all(|c| c.is_ascii_graphic()),
            "section name must not contain non-printable ASCII characters (less than `0x21` or greater than `0x7E`)"
        );
        assert!(
            self.sections.len() <= 255,
            "container file can only contain up to 255 sections"
        );
        self.sections.insert(name, section)
    }
pub fn add_section ( & mut self , name : Symbol , section : Section ) -> Option < Section > { let name_as_str = name . as_str ( ) ; assert ! ( name_as_str len ( ) 255 " " ) ; assert ! ( name_as_str chars ( ) all ( c c is_ascii_graphic ( ) ) " " ) ; assert ! ( self sections len ( ) 255 " " ) ; self . sections . insert ( name , section ) }
Add a section to the container file.
Add a section to the container file .
&mut self
name
Symbol
section
Section
&mut self
name
Symbol
section
Section
panics
This function will panic if the name of the section was longer than 255
characters, if the name of the section contained non-printable ASCII
characters (less than `0x21` or greater than `0x7E`), or if there were
already 255 sections in the container file.
This function will panic if the name of the section was longer than 255 characters if the name of the section contained non - printable ASCII characters ( less than ` 0x21 ` or greater than ` 0x7E ` ) or if there were already 255 sections in the container file .