railway-core-0.2.0/.cargo_vcs_info.json0000644000000001520000000000100134270ustar { "git": { "sha1": "e328905c7c5270a1f94ac9edc7f50f664ac9ac19" }, "path_in_vcs": "railway-core" }railway-core-0.2.0/Cargo.lock0000644000001351440000000000100114140ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "addr2line" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] name = "adler2" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] [[package]] name = "approx" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ "num-traits", ] [[package]] name = "async-trait" version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", "windows-targets", ] [[package]] name = "base64" version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "shlex", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", "windows-targets", ] [[package]] name = "chrono-tz" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" dependencies = [ "chrono", "chrono-tz-build", "phf", ] [[package]] name = "chrono-tz-build" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" dependencies = [ "parse-zoneinfo", "phf", "phf_codegen", ] [[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "displaydoc" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys 0.59.0", ] [[package]] name = "fastrand" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ "foreign-types-shared", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-sink" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-task", "pin-project-lite", "pin-utils", ] [[package]] name = "geo-types" version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bd1157f0f936bf0cd68dec91e8f7c311afe60295574d62b70d4861a1bfdf2d9" dependencies = [ "approx", "num-traits", "serde", ] [[package]] name = "geojson" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5d728c1df1fbf328d74151efe6cb0586f79ee813346ea981add69bd22c9241b" dependencies = [ "geo-types", "log", "serde", "serde_json", "thiserror", ] [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", "http 1.2.0", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "http" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", "itoa", ] [[package]] name = "http" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", "itoa", ] [[package]] name = "http-body" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http 0.2.12", "pin-project-lite", ] [[package]] name = "http-body" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.2.0", ] [[package]] name = "http-body-util" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", "http 1.2.0", "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", "want", ] [[package]] name = "hyper" version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", "h2", "http 1.2.0", "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", "smallvec", "tokio", "want", ] [[package]] name = "hyper-rustls" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", "hyper 0.14.32", "log", "rustls 0.21.12", "rustls-native-certs", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "hyper-rustls" version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.2.0", "hyper 1.5.2", "hyper-util", "rustls 0.23.21", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", "tower-service", ] [[package]] name = "hyper-tls" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", "hyper 1.5.2", "hyper-util", "native-tls", "tokio", "tokio-native-tls", "tower-service", ] [[package]] name = "hyper-util" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.2.0", "http-body 1.0.1", "hyper 1.5.2", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "windows-core", ] [[package]] name = "iana-time-zone-haiku" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "icu_collections" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ "displaydoc", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locid" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_locid_transform" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ "displaydoc", "icu_locid", "icu_locid_transform_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_locid_transform_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] name = "icu_normalizer" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "utf16_iter", "utf8_iter", "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] name = "icu_properties" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ "displaydoc", "icu_collections", "icu_locid_transform", "icu_properties_data", "icu_provider", "tinystr", "zerovec", ] [[package]] name = "icu_properties_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] name = "icu_provider" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ "displaydoc", "icu_locid", "icu_provider_macros", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_provider_macros" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "idna" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ "idna_adapter", "smallvec", "utf8_iter", ] [[package]] name = "idna_adapter" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "indexmap" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "itoa" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", ] [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "log" version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] [[package]] name = "mio" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi", "windows-sys 0.52.0", ] [[package]] name = "native-tls" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ "libc", "log", "openssl", "openssl-probe", "openssl-sys", "schannel", "security-framework", "security-framework-sys", "tempfile", ] [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", ] [[package]] name = "object" version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", "openssl-macros", "openssl-sys", ] [[package]] name = "openssl-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "parse-zoneinfo" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" dependencies = [ "regex", ] [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_shared", ] [[package]] name = "phf_codegen" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", "phf_shared", ] [[package]] name = "phf_generator" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", ] [[package]] name = "phf_shared" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "proc-macro2" version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] [[package]] name = "railway-core" version = "0.2.0" dependencies = [ "async-trait", "chrono", "chrono-tz", "geojson", "hyper 0.14.32", "hyper-rustls 0.24.2", "log", "reqwest", "rustls 0.21.12", "rustls-pemfile 2.2.0", "serde", "url", ] [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "rand_core", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "regex" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", "http 1.2.0", "http-body 1.0.1", "http-body-util", "hyper 1.5.2", "hyper-rustls 0.27.5", "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", "tower", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "windows-registry", ] [[package]] name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", "getrandom", "libc", "spin", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", "windows-sys 0.59.0", ] [[package]] name = "rustls" version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls" version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "once_cell", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile 1.0.4", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64 0.21.7", ] [[package]] name = "rustls-pemfile" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ "rustls-pki-types", ] [[package]] name = "rustls-pki-types" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", ] [[package]] name = "rustls-webpki" version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", "untrusted", ] [[package]] name = "rustversion" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", ] [[package]] name = "security-framework" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "serde" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", "ryu", "serde", ] [[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", "serde", ] [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "siphasher" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "tempfile" version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", ] [[package]] name = "thiserror" version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tinystr" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tokio" version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", "libc", "mio", "pin-project-lite", "socket2", "windows-sys 0.52.0", ] [[package]] name = "tokio-native-tls" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", ] [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls 0.23.21", "tokio", ] [[package]] name = "tokio-util" version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "tower" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", "sync_wrapper", "tokio", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-ident" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf16_iter" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ "try-lock", ] [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets", ] [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result", "windows-strings", "windows-targets", ] [[package]] name = "windows-result" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ "windows-targets", ] [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", "windows-targets", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "write16" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] name = "writeable" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerofrom" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zerovec" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", "syn", ] railway-core-0.2.0/Cargo.toml0000644000000035510000000000100114330ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "railway-core" version = "0.2.0" authors = ["Julian Schmidhuber "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Core type definitions of the Railway backend" readme = "README.md" keywords = [ "railway-backend", "train", "public-transport", ] license = "AGPL-3.0-or-later OR EUPL-1.2" repository = "https://gitlab.com/schmiddi-on-mobile/railway-backend" [features] hyper-requester = [ "hyper-rustls", "hyper", "rustls", "rustls-pemfile", ] polylines = ["geojson"] reqwest-requester = ["reqwest"] rt-multi-thread = [] serde = [ "dep:serde", "chrono/serde", ] [lib] name = "railway_core" path = "src/lib.rs" [dependencies.async-trait] version = "0.1" [dependencies.chrono] version = "0.4" [dependencies.chrono-tz] version = "0.8" [dependencies.geojson] version = "0.24" optional = true [dependencies.hyper] version = "0.14" optional = true [dependencies.hyper-rustls] version = "0.24" features = ["http1"] optional = true [dependencies.log] version = "0.4" [dependencies.reqwest] version = "0.12" optional = true [dependencies.rustls] version = "0.21" optional = true [dependencies.rustls-pemfile] version = "2.1" optional = true [dependencies.serde] version = "1.0" features = ["derive"] optional = true [dependencies.url] version = "2.5" railway-core-0.2.0/Cargo.toml.orig000064400000000000000000000024241046102023000151120ustar 00000000000000[package] name = "railway-core" version = "0.2.0" authors = ["Julian Schmidhuber "] edition = "2021" description = "Core type definitions of the Railway backend" repository = "https://gitlab.com/schmiddi-on-mobile/railway-backend" license = "AGPL-3.0-or-later OR EUPL-1.2" keywords = ["railway-backend", "train", "public-transport"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] async-trait = "0.1" log = "0.4" chrono = { version = "0.4" } chrono-tz = "0.8" url = "2.5" geojson = { version = "0.24", optional = true } # Hyper Requester hyper = { version = "0.14", optional = true } hyper-rustls = { version = "0.24", optional = true, features = [ "http1" ] } # Note: A newer version is already available, but conflicts with the one usef for hyper rustls = { version = "0.21", optional = true } rustls-pemfile = { version = "2.1", optional = true } # Reqwest Requester reqwest = { version = "0.12", optional = true } serde = { version = "1.0", features = [ "derive" ], optional = true } [features] hyper-requester = [ "hyper-rustls", "hyper", "rustls", "rustls-pemfile" ] reqwest-requester = [ "reqwest" ] rt-multi-thread = [ ] polylines = [ "geojson" ] serde = [ "dep:serde", "chrono/serde" ] railway-core-0.2.0/README.md000064400000000000000000000004711046102023000135020ustar 00000000000000# Railway Core Core type definitions of the Railway backend. This crate is part of [railway-backend](https://gitlab.com/schmiddi-on-mobile/railway-backend). You can find a high-level documentation of railway-backend [here](https://gitlab.com/schmiddi-on-mobile/railway-backend/-/tree/main/docs?ref_type=heads). railway-core-0.2.0/src/api/journeys.rs000064400000000000000000000066641046102023000160210ustar 00000000000000use chrono::{DateTime, Duration}; use chrono_tz::Tz; use crate::{Accessibility, Age, Journey, LoyaltyCard, Place, ProductsSelection, TariffClass}; #[derive(Debug, Clone)] /// The options for [`Provider::journeys`](crate::Provider::journeys) /// /// A provider can also ignore some of the options if this is not supported by the API. pub struct JourneysOptions { /// Intermediate place to route with. pub via: Vec, /// Specify to route earlier than, from [`JourneysResponse::earlier_ref`]. pub earlier_than: Option, /// Specify to route earlierthan , from [`JourneysResponse::later_ref`]. pub later_than: Option, /// How many results to include. pub results: u64, /// Whether to include stopovers. pub stopovers: bool, /// Whether to include polylines. #[cfg(feature = "polylines")] pub polylines: bool, /// Route in a bike-friendly way. pub bike_friendly: bool, /// Include tickets. pub tickets: bool, /// Allow to walk to the initial station. pub start_with_walking: bool, /// How accessible the journey must be. pub accessibility: Accessibility, /// How often it is allowed to transfer. pub transfers: TransferOptions, /// How long must the transfers be. pub transfer_time: Duration, /// When should the journey arrive, or earlier. pub arrival: Option>, /// When should the journey depart, or later. pub departure: Option>, /// What products to route with. pub products: ProductsSelection, /// What class to use. pub tariff_class: TariffClass, /// What language to query with. pub language: Option, /// What loyalty cards does the passenger have. pub loyalty_card: Option, /// What age does the passenger have. pub passenger_age: Option, } /// How often is a journey allowed to transfer. #[derive(Debug, Clone, Default)] pub enum TransferOptions { /// Allow unlimited transfers. #[default] Unlimited, /// Allow transfers only to a limited number. Limited(u64), } impl Default for JourneysOptions { fn default() -> Self { Self { via: Default::default(), earlier_than: Default::default(), later_than: Default::default(), results: 5, stopovers: Default::default(), #[cfg(feature = "polylines")] polylines: Default::default(), bike_friendly: Default::default(), tickets: true, start_with_walking: true, accessibility: Default::default(), transfers: TransferOptions::default(), transfer_time: Duration::zero(), arrival: Default::default(), departure: Default::default(), products: Default::default(), tariff_class: TariffClass::Second, language: Default::default(), loyalty_card: Default::default(), passenger_age: Default::default(), } } } /// The response for [`Provider::journeys`](crate::Provider::journeys) #[derive(Debug, Clone)] pub struct JourneysResponse { /// Reference to query earlier, used in [`JourneysOptions::earlier_than`]. pub earlier_ref: Option, /// Reference to query later, used in [`JourneysOptions::later_than`]. pub later_ref: Option, /// The list of journeys which is the result of the request. pub journeys: Vec, } railway-core-0.2.0/src/api/locations.rs000064400000000000000000000012001046102023000161130ustar 00000000000000use crate::Place; /// The response given by [`Provider::locations`](crate::Provider::locations) pub type LocationsResponse = Vec; #[derive(Debug)] /// The options for [`Provider::locations`](crate::Provider::locations) pub struct LocationsOptions { /// What to query for. pub query: String, /// How many results to return. pub results: u64, /// What language to query in. pub language: Option, } impl Default for LocationsOptions { fn default() -> Self { Self { query: Default::default(), results: 10, language: Default::default(), } } } railway-core-0.2.0/src/api/mod.rs000064400000000000000000000042211046102023000147050ustar 00000000000000mod journeys; mod locations; mod refresh_journey; mod station_board; pub use journeys::*; pub use locations::*; pub use refresh_journey::*; pub use station_board::*; use crate::{Journey, Place, Requester}; use async_trait::async_trait; /// The core type definition specifying what a provider needs to do. /// /// To implement the required methods, a provider usually queries an external but public API. #[cfg_attr(feature = "rt-multi-thread", async_trait)] #[cfg_attr(not(feature = "rt-multi-thread"), async_trait(?Send))] pub trait Provider { type Error: std::error::Error; /// Query a list of journeys. /// /// Be careful about timezones! /// The types given to you are annotated with an arbitrary timezone, your public API may only understand one specific timezone though. /// Ensure you correctly convert the given timezone to a timezone you require. /// For returning a date and time, you may choose an arbitrary timezone. async fn journeys( &self, from: Place, to: Place, opts: JourneysOptions, ) -> Result>; /// Autocomplete a location. /// /// This takes a query string and should return a list of locations which match the given string. async fn locations( &self, opts: LocationsOptions, ) -> Result>; /// Query a list of arrivals/departures from a given station. async fn station_board( &self, place: Place, kind: StationBoardKind, opts: StationBoardOptions, ) -> Result>; /// Refresh a journey. /// /// This takes a previously queried journey and refreshes real-time data. /// A naive implementation may call [`Provider::journeys`] again and return the matching journey, this is a valid strategy if there is no API for refreshing a journey. async fn refresh_journey( &self, journey: &Journey, opts: RefreshJourneyOptions, ) -> Result>; } railway-core-0.2.0/src/api/refresh_journey.rs000064400000000000000000000013471046102023000173450ustar 00000000000000use crate::{Journey, TariffClass}; #[derive(Debug, Default)] /// The options for [`Provider::refresh_journey`](crate::Provider::refresh_journey) /// /// A provider can also ignore some of the options if this is not supported by the API. pub struct RefreshJourneyOptions { /// Whether to include stopovers. pub stopovers: bool, #[cfg(feature = "polylines")] /// Whether to include polylines. pub polylines: bool, /// Include tickets. pub tickets: bool, /// What class to use. pub tariff_class: TariffClass, /// What language to query with. pub language: Option, } /// The result for [`Provider::refresh_journey`](crate::Provider::refresh_journey) pub type RefreshJourneyResponse = Journey; railway-core-0.2.0/src/api/station_board.rs000064400000000000000000000024761046102023000167700ustar 00000000000000use chrono::DateTime; use chrono_tz::Tz; use crate::{Accessibility, Leg, ProductsSelection}; /// The type of station board (departures, arrivals) pub enum StationBoardKind { Departures, Arrivals, } #[derive(Debug, Clone)] /// The options for [`Provider::station_board`](crate::Provider::station_board) /// /// A provider can also ignore some of the options if this is not supported by the API. pub struct StationBoardOptions { /// How many results to include. pub results: u64, /// When should the station board start. pub when: Option>, /// How accessible the journey must be. pub accessibility: Accessibility, /// What products to route with. pub products: ProductsSelection, /// What language to query with. pub language: Option, } impl Default for StationBoardOptions { fn default() -> Self { StationBoardOptions { results: 5, when: Default::default(), accessibility: Default::default(), products: Default::default(), language: Default::default(), } } } /// The response for [`Provider::station_board`](crate::Provider::station_board) #[derive(Debug, Clone)] pub struct StationBoardResponse { /// The list of legs which is the result of the request. pub legs: Vec, } railway-core-0.2.0/src/error.rs000064400000000000000000000016541046102023000145150ustar 00000000000000use std::error::Error as StdError; use std::fmt::{Display, Formatter}; /// An error in the API. #[derive(Debug)] pub enum Error { /// Error requesting data using the [`Requester`](crate::Requester). Request(R), /// Any [`Provider`](crate::Provider)-specific error, e.g. failing to parse the response from the API. Provider(P), // TODO: Journey not found, ... /// Provider doesn't have implementation for this specific feature NotImplemented, } impl Display for Error { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { match self { Self::Request(e) => write!(f, "error requesting data: {}", e), Self::Provider(e) => write!(f, "provider specific error: {}", e), Self::NotImplemented => write!(f, "not implemented by this provider"), } } } impl StdError for Error {} railway-core-0.2.0/src/lib.rs000064400000000000000000000003121046102023000141200ustar 00000000000000#![doc = include_str!("../README.md")] mod api; mod error; mod requester; #[cfg(feature = "serde")] mod serialize; mod types; pub use api::*; pub use error::*; pub use requester::*; pub use types::*; railway-core-0.2.0/src/requester/hyper.rs000064400000000000000000000124201046102023000165230ustar 00000000000000use crate::{Requester, RequesterBuilder}; use async_trait::async_trait; use hyper::client::HttpConnector; use hyper::{Body, Method, Request}; use hyper_rustls::builderstates::WantsProtocols2; use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder}; use std::collections::HashMap; #[derive(Clone)] #[deprecated(note = "Use ReqwestRequester instead")] pub struct HyperRustlsRequester(hyper::Client, Body>); #[cfg_attr(feature = "rt-multi-thread", async_trait)] #[cfg_attr(not(feature = "rt-multi-thread"), async_trait(?Send))] impl Requester for HyperRustlsRequester { type Error = HyperRustlsRequesterError; async fn get( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error> { self.request(Method::GET, url, body, headers).await } async fn post( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error> { self.request(Method::POST, url, body, headers).await } } #[deprecated(note = "Use ReqwestRequesterBuilder instead")] pub struct HyperRustlsRequesterBuilder( hyper::client::Builder, HttpsConnectorBuilder, ); impl RequesterBuilder for HyperRustlsRequesterBuilder { type Requester = HyperRustlsRequester; fn with_pem_bundle(mut self, bytes: &[u8]) -> Self { let mut bytes = &bytes[..]; // TODO: This only allows calling this function once. self.1 = HttpsConnectorBuilder::new() .with_tls_config({ let mut store = rustls::RootCertStore::empty(); let certs = rustls_pemfile::certs(&mut bytes); for cert in certs.into_iter() { if let Ok(cert) = cert { if let Err(e) = store.add(&rustls::Certificate(cert.to_vec())) { log::error!("Failed to add certificate: {}", e); } } else { log::error!("Failed to read certificate"); } } rustls::ClientConfig::builder() .with_safe_defaults() .with_root_certificates(store) .with_no_client_auth() }) .https_or_http() .enable_http1(); self } fn build(self) -> Self::Requester { let https = self.1.build(); let client = self.0.build(https); HyperRustlsRequester(client) } } impl Default for HyperRustlsRequesterBuilder { fn default() -> Self { Self( hyper::Client::builder(), HttpsConnectorBuilder::new() .with_native_roots() .https_or_http() .enable_http1(), ) } } impl HyperRustlsRequester { pub fn new() -> Self { let https = HttpsConnectorBuilder::new() .with_native_roots() .https_or_http() .enable_http1() .build(); let client = hyper::Client::builder().build(https); Self(client) } async fn request( &self, method: hyper::Method, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, HyperRustlsRequesterError> { log::trace!( "{}: URL: {}, Body: {}, Headers: {:?}", method, url, String::from_utf8_lossy(body), headers ); let body = body.to_vec(); let mut req = Request::builder().method(method).uri(url.as_str()); for (k, v) in headers { req = req.header(k, v); } let req = req.body(Body::from(body)).unwrap(); let (parts, resp_body) = self.0.request(req).await?.into_parts(); let bytes = hyper::body::to_bytes(resp_body).await?; if parts.status.is_success() { Ok(bytes.to_vec()) } else { Err(HyperRustlsRequesterError::NoSuccessStatusCode( parts.status.as_u16(), parts.status.canonical_reason(), bytes.to_vec(), )) } } } impl Default for HyperRustlsRequester { fn default() -> Self { Self::new() } } #[derive(Debug)] pub enum HyperRustlsRequesterError { /// hyper failed. Hyper(hyper::Error), /// Got a status code which is no success. /// Contains the status code, the "canonical reason" and the body bytes. NoSuccessStatusCode(u16, Option<&'static str>, Vec), } impl std::fmt::Display for HyperRustlsRequesterError { fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { match self { Self::Hyper(e) => write!(fmt, "hyper error: {}", e), Self::NoSuccessStatusCode(code, Some(reason), _) => { write!(fmt, "unsuccessful status code {} ({})", code, reason) } Self::NoSuccessStatusCode(code, None, _) => { write!(fmt, "unsuccessful status code {}", code) } } } } impl std::error::Error for HyperRustlsRequesterError {} impl From for HyperRustlsRequesterError { fn from(e: hyper::Error) -> HyperRustlsRequesterError { Self::Hyper(e) } } railway-core-0.2.0/src/requester/mod.rs000064400000000000000000000030411046102023000161520ustar 00000000000000#[cfg(feature = "hyper-requester")] mod hyper; #[cfg(feature = "hyper-requester")] pub use hyper::*; #[cfg(feature = "reqwest-requester")] mod reqwest; #[cfg(feature = "reqwest-requester")] pub use reqwest::*; use async_trait::async_trait; use std::collections::HashMap; /// A general trait to query data from the internet. /// /// This makes requests to a specified API with a specified body and headers, returning the bytes received. /// It only supports limited HTTP(s) capabilities for now, further capabilities may be added if required. #[cfg_attr(feature = "rt-multi-thread", async_trait)] #[cfg_attr(not(feature = "rt-multi-thread"), async_trait(?Send))] pub trait Requester: Send + Sync { /// Errors this requester may produce. type Error: std::error::Error; /// Make a GET request. async fn get( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error>; /// Make a POST request. async fn post( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error>; } /// Build a [`Requester`]. /// /// This allows a provider to specify e.g. custom certificates. pub trait RequesterBuilder { /// The [`Requester`] built by this builder. type Requester: Requester; /// Add a custom certificate, formatted as a PEM-bundle which should be accepted. fn with_pem_bundle(self, bytes: &[u8]) -> Self; /// Build the [`Requester`]. fn build(self) -> Self::Requester; } railway-core-0.2.0/src/requester/reqwest.rs000064400000000000000000000100111046102023000170600ustar 00000000000000use crate::{Requester, RequesterBuilder}; use async_trait::async_trait; use std::collections::HashMap; #[derive(Clone)] pub struct ReqwestRequester(reqwest::Client); impl ReqwestRequester { pub fn inner(&self) -> &reqwest::Client { &self.0 } } #[cfg_attr(feature = "rt-multi-thread", async_trait)] #[cfg_attr(not(feature = "rt-multi-thread"), async_trait(?Send))] impl Requester for ReqwestRequester { type Error = ReqwestRequesterError; async fn get( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error> { self.request(reqwest::Method::GET, url, body, headers).await } async fn post( &self, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, Self::Error> { self.request(reqwest::Method::POST, url, body, headers) .await } } pub struct ReqwestRequesterBuilder(reqwest::ClientBuilder); impl RequesterBuilder for ReqwestRequesterBuilder { type Requester = ReqwestRequester; fn with_pem_bundle(mut self, bytes: &[u8]) -> Self { // TODO: Error when certificate parsing failed? let certificates = reqwest::tls::Certificate::from_pem_bundle(bytes).unwrap_or_default(); for c in certificates { self.0 = self.0.add_root_certificate(c); } self } fn build(self) -> Self::Requester { // TODO: Fail when not able to build? ReqwestRequester(self.0.build().unwrap_or_default()) } } impl Default for ReqwestRequesterBuilder { fn default() -> Self { Self(reqwest::Client::builder()) } } impl ReqwestRequester { pub fn new() -> Self { Self(reqwest::Client::new()) } async fn request( &self, method: reqwest::Method, url: &url::Url, body: &[u8], headers: HashMap<&str, &str>, ) -> Result, ReqwestRequesterError> { log::trace!( "{}: URL: {}, Body: {}, Headers: {:?}", method, url, String::from_utf8_lossy(body), headers ); let body = body.to_vec(); // TODO: Fail on parsing header. let mut req = self.0.request(method, url.clone()).body(body); for (key, value) in headers { req = req.header(key, value); } let response = req.send().await?; let status = response.status(); let bytes = response.bytes().await?; if status.is_success() { Ok(bytes.to_vec()) } else { log::error!( "Request was not successfull; returned body: {}", String::from_utf8_lossy(&bytes) ); Err(ReqwestRequesterError::NoSuccessStatusCode( status.as_u16(), status.canonical_reason(), bytes.to_vec(), )) } } } impl Default for ReqwestRequester { fn default() -> Self { Self::new() } } #[derive(Debug)] pub enum ReqwestRequesterError { /// reqwest failed. Reqwest(reqwest::Error), /// Got a status code which is no success. /// Contains the status code, the "canonical reason" and the body bytes. NoSuccessStatusCode(u16, Option<&'static str>, Vec), } impl std::fmt::Display for ReqwestRequesterError { fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { match self { Self::Reqwest(e) => write!(fmt, "reqwest error: {}", e), Self::NoSuccessStatusCode(code, Some(reason), _) => { write!(fmt, "unsuccessful status code {} ({})", code, reason) } Self::NoSuccessStatusCode(code, None, _) => { write!(fmt, "unsuccessful status code {}", code) } } } } impl std::error::Error for ReqwestRequesterError {} impl From for ReqwestRequesterError { fn from(e: reqwest::Error) -> ReqwestRequesterError { Self::Reqwest(e) } } railway-core-0.2.0/src/serialize.rs000064400000000000000000000030661046102023000153520ustar 00000000000000pub(crate) mod duration { use chrono::Duration; use serde::{Deserialize, Deserializer, Serializer}; pub(crate) fn serialize(v: &Option, s: S) -> Result where S: Serializer, { if let Some(d) = v { s.serialize_some(&d.num_minutes()) } else { s.serialize_none() } } pub(crate) fn deserialize<'de, D>(d: D) -> Result, D::Error> where D: Deserializer<'de>, { let v = Option::::deserialize(d)?; Ok(v.map(Duration::minutes)) } } pub(crate) mod datetime_with_timezone { use chrono::{DateTime, NaiveDateTime}; use chrono_tz::Tz; use serde::{Deserialize, Deserializer, Serializer}; pub(crate) fn serialize(v: &Option>, s: S) -> Result where S: Serializer, { if let Some(d) = v { let tz = d.timezone().to_string(); let naive = d.naive_utc(); s.serialize_some(&(naive, tz)) } else { s.serialize_none() } } pub(crate) fn deserialize<'de, D>(d: D) -> Result>, D::Error> where D: Deserializer<'de>, { let v = Option::<(NaiveDateTime, String)>::deserialize(d)?; if let Some((d, tz)) = v { let tz = tz .parse() .map_err(|_| serde::de::Error::custom("Failed to parse timezone"))?; Ok(Some(d.and_utc().with_timezone(&tz))) } else { Ok(None) } } } railway-core-0.2.0/src/types.rs000064400000000000000000000370321046102023000145270ustar 00000000000000use std::borrow::Cow; use std::collections::HashSet; use chrono::DateTime; use chrono::Duration; use chrono_tz::Tz; #[cfg(feature = "polylines")] use geojson::FeatureCollection; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone)] /// A general location. pub enum Location { /// An address. Address { /// The address. address: String, /// The latitude. latitude: f32, /// The longitude. longitude: f32, }, /// Anything else. Point { /// A not further specified ID. id: Option, /// Some name. name: Option, /// Is this a point of interest. poi: Option, /// The latitude. latitude: f32, /// The longitude. longitude: f32, }, } impl PartialEq for Location { fn eq(&self, other: &Self) -> bool { match (&self, other) { (Location::Address { address: a, .. }, Location::Address { address: b, .. }) => a == b, (Location::Point { id: Some(a), .. }, Location::Point { id: Some(b), .. }) => a == b, (_, _) => false, } } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// Any place. pub enum Place { /// A [`Station`]. Station(Station), /// A [`Location`]. Location(Location), } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Default, Clone)] /// A station where trains drive from. pub struct Station { /// A provider-specific, unique station id. pub id: String, /// A human-readable name pub name: Option, /// Where the station is located. pub location: Option, /// The products served on the station. pub products: Vec, } impl PartialEq for Station { fn eq(&self, other: &Self) -> bool { self.id == other.id } } #[derive(Debug, Clone, PartialEq, Eq)] /// A selection of modes. pub struct ProductsSelection(HashSet); impl Default for ProductsSelection { fn default() -> Self { Self::all() } } impl ProductsSelection { pub fn all() -> Self { // TODO: Automatically generate from enum? Self(HashSet::from([ Mode::HighSpeedTrain, Mode::RegionalTrain, Mode::SuburbanTrain, Mode::Subway, Mode::Tram, Mode::Bus, Mode::Ferry, Mode::Ferry, Mode::Cablecar, Mode::OnDemand, Mode::Unknown, ])) } pub fn contains(&self, mode: &Mode) -> bool { self.0.contains(mode) } } impl From> for ProductsSelection { fn from(modes: HashSet) -> Self { Self(modes) } } impl From for HashSet { fn from(modes: ProductsSelection) -> Self { modes.0 } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// The product a [`Line`] uses. pub struct Product { /// The mode of transport. pub mode: Mode, /// A name. pub name: Cow<'static, str>, /// A shorter name (usually one character). pub short: Cow<'static, str>, } impl Product { pub const fn unknown() -> Self { Self { mode: Mode::Unknown, name: Cow::Borrowed("Unknown"), short: Cow::Borrowed("Unknown"), } } } /// Different modes of transport. /// /// See also . #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Mode { HighSpeedTrain, RegionalTrain, SuburbanTrain, Subway, Tram, Bus, Ferry, Cablecar, OnDemand, Unknown, // TODO: Walking? } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// Different kinds of loyalty cards supported. pub enum LoyaltyCard { BahnCard25Class1, BahnCard25Class2, BahnCard50Class1, BahnCard50Class2, Vorteilscard, HalbtaxaboRailplus, Halbtaxabo, VoordeelurenaboRailplus, Voordeelurenabo, SHCard, Generalabonnement, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// The age of a person in years. pub struct Age(pub u64); impl LoyaltyCard { /// See . pub fn from_id(value: u8) -> Option { match value { 1 => Some(LoyaltyCard::BahnCard25Class1), 2 => Some(LoyaltyCard::BahnCard25Class2), 3 => Some(LoyaltyCard::BahnCard50Class1), 4 => Some(LoyaltyCard::BahnCard50Class2), 9 => Some(LoyaltyCard::Vorteilscard), 10 => Some(LoyaltyCard::HalbtaxaboRailplus), 11 => Some(LoyaltyCard::Halbtaxabo), 12 => Some(LoyaltyCard::VoordeelurenaboRailplus), 13 => Some(LoyaltyCard::Voordeelurenabo), 14 => Some(LoyaltyCard::SHCard), 15 => Some(LoyaltyCard::Generalabonnement), _ => None, } } pub fn to_id(self) -> u8 { match self { LoyaltyCard::BahnCard25Class1 => 1, LoyaltyCard::BahnCard25Class2 => 2, LoyaltyCard::BahnCard50Class1 => 3, LoyaltyCard::BahnCard50Class2 => 4, LoyaltyCard::Vorteilscard => 9, LoyaltyCard::HalbtaxaboRailplus => 10, LoyaltyCard::Halbtaxabo => 11, LoyaltyCard::VoordeelurenaboRailplus => 12, LoyaltyCard::Voordeelurenabo => 13, LoyaltyCard::SHCard => 14, LoyaltyCard::Generalabonnement => 15, } } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] /// What class to travel with. pub enum TariffClass { /// First class. First, /// Second class. Second, } impl Default for TariffClass { fn default() -> Self { Self::Second } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// How accessible a trip should be. pub enum Accessibility { /// Accessibility is not required. r#None, /// Partial accessibility is required. Partial, /// Complete accessibility is required. Complete, } impl Default for Accessibility { fn default() -> Self { Self::None } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Copy, PartialEq, Eq)] /// How full a [`Leg`] is. pub enum LoadFactor { /// Not full. LowToMedium, /// Full. High, /// Very full. VeryHigh, /// Extremely full. ExceptionallyHigh, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// A line serving a [`Leg`]. pub struct Line { /// The line name. pub name: Option, /// The line number. pub fahrt_nr: Option, /// The mode of transport. pub mode: Mode, /// The product of the transport. pub product: Product, /// The operator of the line. pub operator: Option, /// The nameof the product. pub product_name: Option, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// At what frequency the train drives. pub struct Frequency { /// Mimimum duration between the same train. #[cfg_attr(feature = "serde", serde(with = "crate::serialize::duration"))] pub minimum: Option, /// Maximum duration between the same train. #[cfg_attr(feature = "serde", serde(with = "crate::serialize::duration"))] pub maximum: Option, /// How often this iteration occures. pub iterations: Option, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// A leg of a journey. pub struct Leg { /// The origin to enter the train from. pub origin: Place, /// The destination to exit the train from. pub destination: Place, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The real-time departure time. pub departure: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The scheduled departure time. pub planned_departure: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The real-time arrival time. pub arrival: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The scheduled arrival time. pub planned_arrival: Option>, /// Whether this leg is reachable from the previous one. pub reachable: bool, /// A unique ID for the trip. pub trip_id: Option, /// The line serving this leg. pub line: Option, /// The direction of the leg. pub direction: Option, /// The real-time arrival platform. pub arrival_platform: Option, /// The scheduled arrival platform. pub planned_arrival_platform: Option, /// The real-time departure platform. pub departure_platform: Option, /// The scheduled departure platform. pub planned_departure_platform: Option, /// The frequency of the leg. pub frequency: Option, /// Whether this leg was cancelled. pub cancelled: bool, /// Intermediate locations for the leg. pub intermediate_locations: Vec, /// The load of the leg. pub load_factor: Option, /// Remarks on the leg. pub remarks: Vec, /// The polyline of the leg. #[cfg(feature = "polylines")] pub polyline: Option, /// Whether this leg needs to be walked. pub walking: bool, /// Whether this leg requires transfer. pub transfer: bool, /// How long this leg is. pub distance: Option, } impl Leg { // An ID of a leg based on attributes that should not change e.g. when refreshed. pub fn id(&self) -> String { format!( "{};{};{};{};{}", self.trip_id.as_ref().map(|s| &s[..]).unwrap_or_default(), self.planned_departure .as_ref() .map(|t| t.to_string()) .unwrap_or_default(), self.planned_arrival .as_ref() .map(|t| t.to_string()) .unwrap_or_default(), self.planned_departure_platform .as_ref() .map(|s| &s[..]) .unwrap_or_default(), self.planned_arrival_platform .as_ref() .map(|s| &s[..]) .unwrap_or_default() ) } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] // Almost always, we have `IntermediateLocation::Stop`. As the documentation for this lint suggests, boxing the larger variant which is almost always used is counterproductive. #[allow(clippy::large_enum_variant)] /// An intermediate locaion of a leg. pub enum IntermediateLocation { /// A place where the train stops to let out passengers. Stop(Stop), /// A named railway track the train is passing over. Railway(Place), } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// A place where the train stops. pub struct Stop { /// The place of the stop. pub place: Place, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The real-time departure time. pub departure: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The scheduled departure time. pub planned_departure: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The real-time arrival time. pub arrival: Option>, #[cfg_attr( feature = "serde", serde(with = "crate::serialize::datetime_with_timezone") )] /// The scheduled arrival time. pub planned_arrival: Option>, /// The real-time arrival platform. pub arrival_platform: Option, /// The scheduled arrival platform. pub planned_arrival_platform: Option, /// The real-time departure platform. pub departure_platform: Option, /// The real-time departure platform. pub planned_departure_platform: Option, /// Whether this stop is cancelled. pub cancelled: bool, /// Remarks specific to this stop. pub remarks: Vec, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// The price of the trip. pub struct Price { /// The amount. pub amount: f64, /// The currency. pub currency: String, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq)] /// A single journey from source to destination. pub struct Journey { /// A unique journey id. pub id: String, /// The legs that make up the journey. pub legs: Vec, /// The price of the journey. pub price: Option, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// The operator serving a [`Line`]. pub struct Operator { /// An unique id. pub id: String, /// The name. pub name: String, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// What type a remark has. pub enum RemarkType { /// It is a hint, e.g. information that bikes are not allowed. Hint, /// It is a status, e.g. that the trip is cancelled. Status, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// What to associate a [`Remark`] with. pub enum RemarkAssociation { /// E.g. bikes allowed, disallowed, limited. Bike, /// E.g. accessible equipment in the train. Accessibility, /// E.g. one can buy tickets in the train. Ticket, /// There is a power socket in the train. Power, /// There is air conditioning on the train. AirConditioning, /// There is WiFi on the train. WiFi, /// There is no first class on this train. OnlySecondClass, /// The remark code specifies an association, but this could not yet be decoded. Unknown, /// The remark did not specify an association. None, } impl Default for RemarkAssociation { fn default() -> Self { Self::Unknown } } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] /// A remark on a leg or stopover. pub struct Remark { /// The provider-specific code for it. pub code: String, /// Text to display. pub text: String, /// What kind of remark it has. pub r#type: RemarkType, /// What to associate the remark with. pub association: RemarkAssociation, /// A short summary of the remark. pub summary: Option, /// What trip this remark is about. pub trip_id: Option, }