pub struct EnumTypeRegistry { /* private fields */ }Expand description
Runtime registry mapping PostgreSQL enum OIDs to their type names.
Keyed by OID for O(1) lookups on the hot path (accepts_with_registry).
Supports multiple schemas having enums with the same name (different OIDs).
Implementations§
Source§impl EnumTypeRegistry
impl EnumTypeRegistry
pub fn new() -> Self
Sourcepub fn insert(&mut self, name: String, entry: EnumOidEntry)
pub fn insert(&mut self, name: String, entry: EnumOidEntry)
Insert an OID entry for the given type name.
Sourcepub fn has_oid_for_type(&self, name: &str, oid: i32) -> bool
pub fn has_oid_for_type(&self, name: &str, oid: i32) -> bool
Check if the given OID matches any entry for the named type.
Sourcepub fn is_enum_array_oid(&self, oid: i32) -> bool
pub fn is_enum_array_oid(&self, oid: i32) -> bool
Check if the given OID matches any registered enum array OID.
Sourcepub fn element_oid_for_array_oid(&self, array_oid: i32) -> Option<i32>
pub fn element_oid_for_array_oid(&self, array_oid: i32) -> Option<i32>
Look up the element OID for a registered enum array OID.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for EnumTypeRegistry
impl Clone for EnumTypeRegistry
Source§fn clone(&self) -> EnumTypeRegistry
fn clone(&self) -> EnumTypeRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnumTypeRegistry
impl Debug for EnumTypeRegistry
Source§impl Default for EnumTypeRegistry
impl Default for EnumTypeRegistry
Source§fn default() -> EnumTypeRegistry
fn default() -> EnumTypeRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnumTypeRegistry
impl RefUnwindSafe for EnumTypeRegistry
impl Send for EnumTypeRegistry
impl Sync for EnumTypeRegistry
impl Unpin for EnumTypeRegistry
impl UnsafeUnpin for EnumTypeRegistry
impl UnwindSafe for EnumTypeRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more