generalize the `Option<NonNullablePtr>` to libs