Debian Codegraph @

src/types/text.rs

raw symbols SCIP
1 use craterust-analyzer cargo sqlx-postgres 0.8.3 crate/::{PgArgumentBufferrust-analyzer cargo sqlx-postgres 0.8.3 arguments/PgArgumentBuffer#, PgTypeInforust-analyzer cargo sqlx-postgres 0.8.3 type_info/PgTypeInfo#, PgValueRefrust-analyzer cargo sqlx-postgres 0.8.3 value/PgValueRef#, Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#};
2 use sqlx_corerust-analyzer cargo sqlx-core 0.8.3 crate/::decoderust-analyzer cargo sqlx-core 0.8.3 decode/::Decoderust-analyzer cargo sqlx-core 0.8.3 decode/Decode#;
3 use sqlx_corerust-analyzer cargo sqlx-core 0.8.3 crate/::encoderust-analyzer cargo sqlx-core 0.8.3 encode/::{Encoderust-analyzer cargo sqlx-core 0.8.3 encode/Encode#, IsNullrust-analyzer cargo sqlx-core 0.8.3 encode/IsNull#};
4 use sqlx_corerust-analyzer cargo sqlx-core 0.8.3 crate/::errorrust-analyzer cargo sqlx-core 0.8.3 error/::BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#;
5 use sqlx_corerust-analyzer cargo sqlx-core 0.8.3 crate/::typesrust-analyzer cargo sqlx-core 0.8.3 types/::{Textrust-analyzer cargo sqlx-core 0.8.3 types/text/Text#, Typerust-analyzer cargo sqlx-core 0.8.3 types/Type#};
6 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#;
7 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#;
8
9 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#;
10
11 impl<T> Typerust-analyzer cargo sqlx-core 0.8.3 types/Type#<Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#> for Textrust-analyzer cargo sqlx-core 0.8.3 types/text/Text#<T> {
12 fn type_inforust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Type<Postgres>`]type_info().() -> PgTypeInforust-analyzer cargo sqlx-postgres 0.8.3 type_info/PgTypeInfo# {
13 <Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# as Typerust-analyzer cargo sqlx-core 0.8.3 types/Type#<Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#>>::type_inforust-analyzer cargo sqlx-postgres 0.8.3 types/str/impl#[String][`Type<Postgres>`]type_info().()
14 }
15
16 fn compatiblerust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Type<Postgres>`]compatible().(ty: &PgTypeInforust-analyzer cargo sqlx-postgres 0.8.3 type_info/PgTypeInfo#) -> bool {
17 <Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# as Typerust-analyzer cargo sqlx-core 0.8.3 types/Type#<Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#>>::compatiblerust-analyzer cargo sqlx-postgres 0.8.3 types/str/impl#[String][`Type<Postgres>`]compatible().(ty)
18 }
19 }
20
21 impl<'q, T> Encoderust-analyzer cargo sqlx-core 0.8.3 encode/Encode#<'q, Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#> for Textrust-analyzer cargo sqlx-core 0.8.3 types/text/Text#<T>
22 where
23 T: Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#,
24 {
25 fn encode_by_refrust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Encode<'q, Postgres>`]encode_by_ref().(&self, buf: &mut PgArgumentBufferrust-analyzer cargo sqlx-postgres 0.8.3 arguments/PgArgumentBuffer#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IsNullrust-analyzer cargo sqlx-core 0.8.3 encode/IsNull#, BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#> {
26 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(*rust-analyzer cargo sqlx-postgres 0.8.3 arguments/impl#[PgArgumentBuffer][DerefMut]deref_mut().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().buf, "{}", self.0rust-analyzer cargo sqlx-core 0.8.3 types/text/Text#0.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
27 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IsNullrust-analyzer cargo sqlx-core 0.8.3 encode/IsNull#::Norust-analyzer cargo sqlx-core 0.8.3 encode/IsNull#No#)
28 }
29 }
30
31 impl<'r, T> Decoderust-analyzer cargo sqlx-core 0.8.3 decode/Decode#<'r, Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#> for Textrust-analyzer cargo sqlx-core 0.8.3 types/text/Text#<T>
32 where
33 T: FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#,
34 BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#: Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<<T as FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#>::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#>,
35 {
36 fn decoderust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Decode<'r, Postgres>`]decode().(value: PgValueRefrust-analyzer cargo sqlx-postgres 0.8.3 value/PgValueRef#<'r>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Decode<'r, Postgres>`], BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#> {
37 let s: &str = Decoderust-analyzer cargo sqlx-core 0.8.3 decode/Decode#::<Postgresrust-analyzer cargo sqlx-postgres 0.8.3 database/Postgres#>::decoderust-analyzer cargo sqlx-postgres 0.8.3 types/str/impl#[`&'r str`][`Decode<'r, Postgres>`]decode().(value)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
38 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/text/impl#[`Text<T>`][`Decode<'r, Postgres>`](s.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))
39 }
40 }