code: func Export(mgr Reader) *statefile.File {
  	switch mgrT := mgr.(type) {
  	case Migrator:
  		return mgrT.StateForMigration()
  	case PersistentMeta:
  		s := mgr.State()
  		meta := mgrT.StateSnapshotMeta()
  		return statefile.New(s, meta.Lineage, meta.Serial)
  	default:
  		s := mgr.State()
  		return statefile.New(s, "", 0)
  	}
  }
docs: // Export retrieves the latest state snapshot from the given manager, including
  // its metadata (serial and lineage) where possible.
  //
  // A state manager must also implement either Migrator or PersistentMeta
  // for the metadata to be included. Otherwise, the relevant fields will have
  // zero value in the returned object.
  //
  // For state managers that also implement Persistent, it is the caller's
  // responsibility to refresh from persistent storage first if needed.
  //
  // This function doesn't do any locking of its own, so if the state manager
  // also implements Locker the caller should hold a lock on it for the
  // duration of this call.