pub struct ArrayDim { /* private fields */ }Expand description
One dimension of an array, its lower bound and its length.
Implementations§
Source§impl ArrayDim
impl ArrayDim
Sourcepub fn new(lower: i32, length: u32) -> Option<Self>
pub fn new(lower: i32, length: u32) -> Option<Self>
The dimension of length from lower, or None when lower + length overflows i32,
as ArrayCheckBounds refuses it, so the upper bound stays below i32::MAX.
use sql_values::postgres::ArrayDim;
let dim = ArrayDim::new(-1, 3).unwrap();
assert_eq!(dim.lower(), -1);
assert_eq!(dim.length(), 3);
assert!(ArrayDim::new(i32::MAX - 1, 1).is_some());
assert!(ArrayDim::new(i32::MAX, 1).is_none());Trait Implementations§
impl Copy for ArrayDim
impl Eq for ArrayDim
impl StructuralPartialEq for ArrayDim
Auto Trait Implementations§
impl Forget for ArrayDim
impl Freeze for ArrayDim
impl Move for ArrayDim
impl RefUnwindSafe for ArrayDim
impl Send for ArrayDim
impl Sync for ArrayDim
impl Unpin for ArrayDim
impl UnsafeUnpin for ArrayDim
impl UnwindSafe for ArrayDim
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