support for struct encoding