| 1 | use bit_vec_08rust-analyzer cargo bit-vec 0.8.0 crate/::BitVecrust-analyzer cargo bit-vec 0.8.0 BitVec#; |
| 2 | use bytesrust-analyzer cargo bytes 1.11.1 crate/::BytesMutrust-analyzer cargo bytes 1.11.1 bytes_mut/BytesMut#; |
| 3 | use postgres_protocolrust-analyzer cargo postgres-protocol 0.6.12 crate/::typesrust-analyzer cargo postgres-protocol 0.6.12 types/; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 5 | |
| 6 | use craterust-analyzer cargo postgres-types 0.2.14 crate/::{FromSqlrust-analyzer cargo postgres-types 0.2.14 FromSql#, IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#, ToSqlrust-analyzer cargo postgres-types 0.2.14 ToSql#, Typerust-analyzer cargo postgres-types 0.2.14 Type#}; |
| 7 | |
| 8 | impl<'a> FromSqlrust-analyzer cargo postgres-types 0.2.14 FromSql#<'a> for BitVecrust-analyzer cargo bit-vec 0.8.0 BitVec# { |
| 9 | fn from_sqlrust-analyzer cargo postgres-types 0.2.14 bit_vec_08/impl#[BitVec][`FromSql<'a>`]from_sql().(_: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, raw: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<BitVecrust-analyzer cargo bit-vec 0.8.0 BitVec#, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 10 | let varbit = typesrust-analyzer cargo postgres-protocol 0.6.12 types/::varbit_from_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/varbit_from_sql().(raw)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 11 | let mut bitvec = BitVecrust-analyzer cargo bit-vec 0.8.0 BitVec#::from_bytesrust-analyzer cargo bit-vec 0.8.0 impl#[BitVec]from_bytes().(varbit.bytesrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[`Varbit<'a>`]bytes().()); |
| 12 | while bitvec.lenrust-analyzer cargo bit-vec 0.8.0 impl#[`BitVec<B>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().varbit.lenrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[`Varbit<'a>`]len().() { |
| 13 | bitvec.poprust-analyzer cargo bit-vec 0.8.0 impl#[`BitVec<B>`]pop().(); |
| 14 | } |
| 15 | |
| 16 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(bitvec) |
| 17 | } |
| 18 | |
| 19 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(BITrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]BIT., VARBITrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]VARBIT.); |
| 20 | } |
| 21 | |
| 22 | impl ToSqlrust-analyzer cargo postgres-types 0.2.14 ToSql# for BitVecrust-analyzer cargo bit-vec 0.8.0 BitVec# { |
| 23 | fn to_sqlrust-analyzer cargo postgres-types 0.2.14 bit_vec_08/impl#[BitVec][ToSql]to_sql().(&self, _: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, out: &mut BytesMutrust-analyzer cargo bytes 1.11.1 bytes_mut/BytesMut#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 24 | typesrust-analyzer cargo postgres-protocol 0.6.12 types/::varbit_to_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/varbit_to_sql().(self.lenrust-analyzer cargo bit-vec 0.8.0 impl#[`BitVec<B>`]len().(), self.to_bytesrust-analyzer cargo bit-vec 0.8.0 impl#[`BitVec<B>`]to_bytes().().into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().(), out)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 25 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#::Norust-analyzer cargo postgres-types 0.2.14 IsNull#No#) |
| 26 | } |
| 27 | |
| 28 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(BITrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]BIT., VARBITrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]VARBIT.); |
| 29 | to_sql_checkedrust-analyzer cargo postgres-types 0.2.14 to_sql_checked!!(); |
| 30 | } |