fn write_get_mut_fn(o: &mut BufWriter<File>, s: &Struct, m: &Member, impl_type_param: &str,
        impl_type_param_block: &str, structs: &HashMap<String, Struct>, is_for_builder: bool)
        -> io::Result<()> {
    let t = INDENT;
    let sig = MemberSig::new(m, s, structs, impl_type_param);
    if member_is_excluded(&m.orig_name) || m.is_ptr_count || !sig.member_is_contained_struct {
        return Ok(());
    }
    assert!(!m.is_handle_type);
    assert!(!m.is_ptr);
    assert!(m.array_len.is_none());
    assert!(sig.arg_is_repr_c);
    let return_type = format!("&'a mut {}", &sig.arg_type);
    let get_pre = if is_for_builder { "get_" } else { "" };

    writeln!(o, "{t}pub fn {}{}_mut<{}>(&'a mut self) -> {} {{", get_pre, sig.fn_name,
        sig.get_fn_type_params, return_type, t=t)?;

    write!(o, "{t}{t}unsafe {{ &mut *(&mut self.raw.{} as *mut  {}{} as *mut {}) }}", m.orig_name,
        ORIG_PRE, m.orig_type, m.voodoo_type, t=t)?;

    write!(o, "\n")?;

    write!(o, "{t}}}\n\n", t=t)?;
    Ok(())
}
/// Writes a mutable getter function for contained structs to the output buffer.
Writes a mutable getter function for contained structs to the output buffer.
Writes a mutable getter function for contained structs to the output buffer .
fn write_get_mut_fn(o: &mut BufWriter<File>, s: &Struct, m: &Member, impl_type_param: &str,
        impl_type_param_block: &str, structs: &HashMap<String, Struct>, is_for_builder: bool)
        -> io::Result<()> {
    let t = INDENT;
    let sig = MemberSig::new(m, s, structs, impl_type_param);
    if member_is_excluded(&m.orig_name) || m.is_ptr_count || !sig.member_is_contained_struct {
        return Ok(());
    }
    assert!(!m.is_handle_type);
    assert!(!m.is_ptr);
    assert!(m.array_len.is_none());
    assert!(sig.arg_is_repr_c);
    let return_type = format!("&'a mut {}", &sig.arg_type);
    let get_pre = if is_for_builder { "get_" } else { "" };
    writeln!(o, "{t}pub fn {}{}_mut<{}>(&'a mut self) -> {} {{", get_pre, sig.fn_name,
        sig.get_fn_type_params, return_type, t=t)?;
    write!(o, "{t}{t}unsafe {{ &mut *(&mut self.raw.{} as *mut  {}{} as *mut {}) }}", m.orig_name,
        ORIG_PRE, m.orig_type, m.voodoo_type, t=t)?;
    write!(o, "\n")?;
    write!(o, "{t}}}\n\n", t=t)?;
    Ok(())
}
fn write_get_mut_fn ( o : & mut BufWriter < File > , s : & Struct , m : & Member , impl_type_param : & str , impl_type_param_block : & str , structs : & HashMap < String , Struct > , is_for_builder : bool ) -> io :: Result < ( ) > { let t = INDENT ; let sig = MemberSig :: new ( m , s , structs , impl_type_param ) ; if member_is_excluded ( & m . orig_name ) || m . is_ptr_count || ! sig . member_is_contained_struct { return Ok ( ( ) ) ; } assert ! ( m is_handle_type ) ; assert ! ( m is_ptr ) ; assert ! ( m array_len is_none ( ) ) ; assert ! ( sig arg_is_repr_c ) ; let return_type = format ! ( " " sig arg_type ) ; let get_pre = if is_for_builder { " " } else { " " } ; writeln ! ( o " " get_pre sig fn_name sig get_fn_type_params return_type t t ) ? ; write ! ( o " " m orig_name ORIG_PRE m orig_type m voodoo_type t t ) ? ; write ! ( o " \n " ) ? ; write ! ( o " \n \n " t t ) ? ; Ok ( ( ) ) }
Writes a mutable getter function for contained structs to the output buffer.
Writes a mutable getter function for contained structs to the output buffer .
o
&mut BufWriter<File>
s
&Struct
m
&Member
impl_type_param
&str
impl_type_param_block
&str
structs
&HashMap<String, Struct>
is_for_builder
bool
o
&mut BufWriter<File>
s
&Struct
m
&Member
impl_type_param
&str
impl_type_param_block
&str
structs
&HashMap<String, Struct>
is_for_builder
bool