This is the unpublished documentation of wasm-bindgen, the published documentation is available on the main Rust and WebAssembly documentation site . Features documented here may not be available in released versions of wasm-bindgen.

When attached to a pub struct field this indicates that field will not be exposed to JavaScript, and neither getter nor setter will be generated in ES6 class.

# #![allow(unused_variables)]
#fn main() {
use wasm_bindgen::prelude::*;

pub struct Foo {
    pub bar: u32,

    pub baz: u32,

impl Foo {
    pub fn new() -> Self {
        Foo {
            bar: 1,
            baz: 2

Here the bar field will be both readable and writable from JS, but the baz field will be undefined in JS.

import('./pkg/').then(rust => {
    let foo =;
    // bar is accessible by getter
    // field marked with `skip` is undefined

    // you can shadow it
    foo.baz = 45;       
    // so accessing by getter will return `45`
    // but it won't affect real value in rust memory