This struct works fine for &'static str
s, but is pretty inflexible. The use
case this was presented in was one where StrToken
represents an authentication
token or application secret; in this case, you're basically forced to store the
secret key in the application's binary, since this doesn't let you load it
ad-hoc at runtime, e.g. from a file. Also, in the last two lines of code, we've
forced the token to only live as long as secret
, so token
can't escape the
current stack frame, as secret
will no longer be valid if it does. This whole
implementation is silly and we'd like to be able to do it differently...
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |