pub struct NodeIds(pub Vec<i64>);Expand description
A way’s node IDs from its nodes column, in either layout: a packed bytea (osm.ways_packed, decoded here, far
faster than osm.node_ids in SQL) or an int8[] (osm.ways). With binary COPY, declare the column’s type as it
is: bytea when the table is packed, int8[] otherwise.
use osmflow_sync::NodeIds;
use postgres::types::{FromSql, Type};
// Steps 100, +1, -2, +300, each zigzagged and written as a varint
let ids = NodeIds::from_sql(&Type::BYTEA, &[0xc8, 0x01, 0x02, 0x03, 0xd8, 0x04]).unwrap();
assert_eq!(ids.0, [100, 101, 99, 399]);Tuple Fields§
§0: Vec<i64>Trait Implementations§
impl Eq for NodeIds
Source§impl<'a> FromSql<'a> for NodeIds
impl<'a> FromSql<'a> for NodeIds
Source§fn from_sql(
ty: &Type,
raw: &'a [u8],
) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql( ty: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type in its binary format. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type.impl StructuralPartialEq for NodeIds
Auto Trait Implementations§
impl Forget for NodeIds
impl Freeze for NodeIds
impl Move for NodeIds
impl RefUnwindSafe for NodeIds
impl Send for NodeIds
impl Sync for NodeIds
impl Unpin for NodeIds
impl UnsafeUnpin for NodeIds
impl UnwindSafe for NodeIds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> FromSqlOwned for Twhere
T: for<'a> FromSql<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more