rados.get_rados_ioctx(pool_name) should either have a lifetime bound on the Rados it takes as parameter (which is bothersome for some use-cases) or take self: &Arc<Rados> and store an Arc<Rados> inside (which considering how heavy ioctx is anyway wouldn't have a significant cost, so is probably the better option).
To reproduce:
Rados
by connectingIoCtx
withrados.get_rados_ioctx(pool_name)
Rados
IoCtx
-> segfaults=> API is unsound.
rados.get_rados_ioctx(pool_name)
should either have a lifetime bound on theRados
it takes as parameter (which is bothersome for some use-cases) or takeself: &Arc<Rados>
and store anArc<Rados>
inside (which considering how heavy ioctx is anyway wouldn't have a significant cost, so is probably the better option).