Not sure if this is any better than the docs (which are raw, at best) - I'm a middling beginner rust programmer, but I did do this test[1] for myself and it matches most of the other SDKs.
[1] https://github.com/pcn/check-assume-role-s3/blob/master/src/...