Describe the .. statement in creating struct?


Can someone describe what the .. operator does when making a struct? I couldn’t find it in the docs, but I also was not certain what the terminology was. I see this in libraries like Vulkano,

let ideal = InstanceExtensions {
            khr_surface: true,
            khr_xlib_surface: true,
            khr_xcb_surface: true,
            khr_wayland_surface: true,
            khr_mir_surface: true,
            khr_android_surface: true,
            khr_win32_surface: true,

(first post. super noob)


It basically says “Take a default implementation but override these values”. Someone might have a more nuanced answer than mine :slight_smile:

Details can be found here:


.. is called the update syntax. You can read about it here.
Basically, it’s a way of saying “make an InstanceExtensions struct with the following field/values and for the fields that I did not specify, just copy the values from this other InstanceExtensions struct”