diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0fc67c59..4711349cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,12 +44,12 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} - name: Output Release URL File - run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt + run: echo "${{ steps.create_release.outputs.id }}" > release_id.txt - name: Save Release URL File for publish uses: actions/upload-artifact@v3 with: - name: release_url - path: release_url.txt + name: release_id + path: release_id.txt publish: if: contains(github.ref, 'tags/v') @@ -60,35 +60,44 @@ jobs: os: [ubuntu-22.04, macos-13] include: - os: ubuntu-22.04 - platform: linux-amd64 + targets: > + x86_64-unknown-linux-gnu + aarch64-unknown-linux-gnu - os: macos-13 - platform: darwin-amd64 + targets: > + aarch64-apple-darwin + x86_64-apple-darwin steps: - uses: actions/checkout@v4 with: submodules: recursive + - uses: actions/setup-go@v4 + with: + go-version: '1.20' - name: Load Release URL File from release job uses: actions/download-artifact@v3 with: - path: release_url - name: release_url + path: release_id + name: release_id + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - uses: Swatinem/rust-cache@v2 - name: Build - run: CARGO_BAZEL_ISOLATED=0 CARGO_BAZEL_REPIN=true bazel build --strip=always //clash/... + run: sh ./scripts/build.sh "${{ matrix.targets }}" - name: Get Release Upload URL id: get_release_info run: | - value=`cat release_url/release_url.txt` - echo "upload_url=$value" >> $GITHUB_OUTPUT + value=`cat release_id/release_id.txt` + echo "upload_id=$value" >> $GITHUB_OUTPUT env: TAG_REF_NAME: ${{ github.ref }} REPOSITORY_NAME: ${{ github.repository }} - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.2 + uses: dwenegar/upload-release-assets@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.get_release_info.outputs.upload_url }} - asset_path: ./bazel-bin/clash/clash - asset_name: clash-${{ matrix.platform }} - asset_content_type: application/octet-stream + release_id: ${{ steps.get_release_info.outputs.id }} + assets_path: target/artifacts diff --git a/README.md b/README.md index e8848e05e..cb46a641b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Options: ## 🔗 Links -- [Documentation(Coming Soon)]() +- [Documentation](https://watfaq.gitbook.io/clashrs-user-manual/) - [Config Reference](https://watfaq.github.io/clash-rs/) - [Roadmap](https://github.com/Watfaq/clash-rs/issues/59) diff --git a/clash_lib/src/app/dispatcher/dispatcher.rs b/clash_lib/src/app/dispatcher/dispatcher.rs index ec10ed227..042a89166 100644 --- a/clash_lib/src/app/dispatcher/dispatcher.rs +++ b/clash_lib/src/app/dispatcher/dispatcher.rs @@ -115,12 +115,11 @@ impl Dispatcher { RunMode::Direct => (PROXY_DIRECT, None), }; - let handler = self - .outbound_manager - .read() - .await - .get_outbound(outbound_name) - .expect(format!("unknown rule: {}", outbound_name).as_str()); // should never happen + let mgr = self.outbound_manager.read().await; + let handler = mgr.get_outbound(outbound_name).unwrap_or_else(|| { + debug!("unknown rule: {}, fallback to direct", outbound_name); + mgr.get_outbound(PROXY_DIRECT).unwrap() + }); match handler .connect_stream(&sess, self.resolver.clone()) diff --git a/clash_lib/src/config/def.rs b/clash_lib/src/config/def.rs index 19db254ed..721b3194a 100644 --- a/clash_lib/src/config/def.rs +++ b/clash_lib/src/config/def.rs @@ -58,7 +58,233 @@ impl Display for LogLevel { #[serde(rename_all = "kebab-case", default)] /// Example /// ```yaml -/// port: 7890 +/// --- +/// port: 8888 +/// socks-port: 8889 +/// mixed-port: 8899 + +/// tun: +/// enable: false +/// device-id: "dev://utun1989" + +/// dns: +/// enable: true +/// listen: 127.0.0.1:53553 +/// # udp: 127.0.0.1:53553 +/// # tcp: 127.0.0.1:53553 +/// # dot: 127.0.0.1:53554 +/// # doh: 127.0.0.1:53555 + +/// # ipv6: false # when the false, response to AAAA questions will be empty + +/// # These nameservers are used to resolve the DNS nameserver hostnames below. +/// # Specify IP addresses only +/// default-nameserver: +/// - 114.114.114.114 +/// - 8.8.8.8 +/// enhanced-mode: fake-ip +/// fake-ip-range: 198.18.0.2/16 # Fake IP addresses pool CIDR +/// # use-hosts: true # lookup hosts and return IP record + +/// # Hostnames in this list will not be resolved with fake IPs +/// # i.e. questions to these domain names will always be answered with their +/// # real IP addresses +/// # fake-ip-filter: +/// # - '*.lan' +/// # - localhost.ptlogin2.qq.com + +/// # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. +/// # All DNS questions are sent directly to the nameserver, without proxies +/// # involved. Clash answers the DNS question with the first result gathered. +/// nameserver: +/// - 114.114.114.114 # default value +/// - 1.1.1.1 # default value +/// - tls://1.1.1.1:853 # DNS over TLS +/// - https://1.1.1.1/dns-query # DNS over HTTPS +/// # - dhcp://en0 # dns from dhcp + +/// allow-lan: true +/// mode: rule +/// log-level: debug +/// external-controller: 127.0.0.1:9090 +/// external-ui: "public" +/// # secret: "clash-rs" +/// experimental: +/// ignore-resolve-fail: true + +/// profile: +/// store-selected: true +/// store-fake-ip: false + +/// proxy-groups: +/// - name: "relay" +/// type: relay +/// proxies: +/// - "plain-vmess" +/// - "ws-vmess" +/// - "auto" +/// - "fallback-auto" +/// - "load-balance" +/// - "select" +/// - DIRECT + +/// - name: "relay-one" +/// type: relay +/// use: +/// - "file-provider" + +/// - name: "auto" +/// type: url-test +/// use: +/// - "file-provider" +/// proxies: +/// - DIRECT +/// url: "http://www.gstatic.com/generate_204" +/// interval: 300 + +/// - name: "fallback-auto" +/// type: fallback +/// use: +/// - "file-provider" +/// proxies: +/// - DIRECT +/// url: "http://www.gstatic.com/generate_204" +/// interval: 300 + +/// - name: "load-balance" +/// type: load-balance +/// use: +/// - "file-provider" +/// proxies: +/// - DIRECT +/// strategy: round-robin +/// url: "http://www.gstatic.com/generate_204" +/// interval: 300 + +/// - name: select +/// type: select +/// use: +/// - "file-provider" + +/// - name: test 🌏 +/// type: select +/// use: +/// - "file-provider" +/// proxies: +/// - DIRECT + +/// proxies: +/// - name: plain-vmess +/// type: vmess +/// server: 10.0.0.13 +/// port: 16823 +/// uuid: b831381d-6324-4d53-ad4f-8cda48b30811 +/// alterId: 0 +/// cipher: auto +/// udp: true +/// skip-cert-verify: true +/// - name: ws-vmess +/// type: vmess +/// server: 10.0.0.13 +/// port: 16824 +/// uuid: b831381d-6324-4d53-ad4f-8cda48b30811 +/// alterId: 0 +/// cipher: auto +/// udp: true +/// skip-cert-verify: true +/// network: ws +/// ws-opts: +/// path: /api/v3/download.getFile +/// headers: +/// Host: www.amazon.com + +/// - name: tls-vmess +/// type: vmess +/// server: 10.0.0.13 +/// port: 8443 +/// uuid: 23ad6b10-8d1a-40f7-8ad0-e3e35cd38297 +/// alterId: 0 +/// cipher: auto +/// udp: true +/// skip-cert-verify: true +/// tls: true + +/// - name: h2-vmess +/// type: vmess +/// server: 10.0.0.13 +/// port: 8444 +/// uuid: b831381d-6324-4d53-ad4f-8cda48b30811 +/// alterId: 0 +/// cipher: auto +/// udp: true +/// skip-cert-verify: true +/// tls: true +/// network: h2 +/// h2-opts: +/// path: /ray + +/// - name: vmess-altid +/// type: vmess +/// server: tw-1.ac.laowanxiang.com +/// port: 153 +/// uuid: 46dd0dd3-2cc0-3f55-907c-d94e54877687 +/// alterId: 64 +/// cipher: auto +/// udp: true +/// network: ws +/// ws-opts: +/// path: /api/v3/download.getFile +/// headers: +/// Host: 5607b9d187e655736f563fee87d7283994721.laowanxiang.com +/// - name: "ss-simple" +/// type: ss +/// server: 10.0.0.13 +/// port: 8388 +/// cipher: aes-256-gcm +/// password: "password" +/// udp: true +/// - name: "trojan" +/// type: trojan +/// server: 10.0.0.13 +/// port: 9443 +/// password: password1 +/// udp: true +/// # sni: example.com # aka server name +/// alpn: +/// - h2 +/// - http/1.1 +/// skip-cert-verify: true + +/// proxy-providers: +/// file-provider: +/// type: file +/// path: ./ss.yaml +/// interval: 300 +/// health-check: +/// enable: true +/// url: http://www.gstatic.com/generate_204 +/// interval: 300 + +/// rule-providers: +/// file-provider: +/// type: file +/// path: ./rule-set.yaml +/// interval: 300 +/// behavior: domain + +/// rules: +/// - DOMAIN,ipinfo.io,relay +/// - RULE-SET,file-provider,trojan +/// - GEOIP,CN,relay +/// - DOMAIN-SUFFIX,facebook.com,REJECT +/// - DOMAIN-KEYWORD,google,select +/// - DOMAIN,google.com,select +/// - SRC-IP-CIDR,192.168.1.1/24,DIRECT +/// - GEOIP,CN,DIRECT +/// - DST-PORT,53,trojan +/// - SRC-PORT,7777,DIRECT +/// - MATCH, DIRECT +/// ... /// ``` pub struct Config { /// The HTTP proxy port diff --git a/clash_lib/src/lib.rs b/clash_lib/src/lib.rs index 099f053cc..cb95c6c9a 100644 --- a/clash_lib/src/lib.rs +++ b/clash_lib/src/lib.rs @@ -240,12 +240,12 @@ async fn start_async(opts: Options) -> Result<(), Error> { runners.push(r); } - tasks.push(Box::pin(async move { - futures::future::join_all(runners).await; + runners.push(Box::pin(async move { + shutdown_rx.recv().await; })); tasks.push(Box::pin(async move { - shutdown_rx.recv().await; + futures::future::join_all(runners).await; })); tasks.push(Box::pin(async move { diff --git a/docs/clash_doc/struct.ClashConfigDef.html b/docs/clash_doc/struct.ClashConfigDef.html index d40a4053b..782d65900 100644 --- a/docs/clash_doc/struct.ClashConfigDef.html +++ b/docs/clash_doc/struct.ClashConfigDef.html @@ -28,7 +28,211 @@ /* private fields */ }
Expand description

docs for clash Example

-
port: 7890
+
---
+port: 8888
+socks-port: 8889
+mixed-port: 8899
+tun:
+  enable: false
+  device-id: "dev://utun1989"
+dns:
+  enable: true
+  listen: 127.0.0.1:53553
+  #   udp: 127.0.0.1:53553
+  #   tcp: 127.0.0.1:53553
+  #   dot: 127.0.0.1:53554
+  #   doh: 127.0.0.1:53555
+  # ipv6: false # when the false, response to AAAA questions will be empty
+  # These nameservers are used to resolve the DNS nameserver hostnames below.
+  # Specify IP addresses only
+  default-nameserver:
+    - 114.114.114.114
+    - 8.8.8.8
+  enhanced-mode: fake-ip
+  fake-ip-range: 198.18.0.2/16 # Fake IP addresses pool CIDR
+  # use-hosts: true # lookup hosts and return IP record
+  # Hostnames in this list will not be resolved with fake IPs
+  # i.e. questions to these domain names will always be answered with their
+  # real IP addresses
+  # fake-ip-filter:
+  #   - '*.lan'
+  #   - localhost.ptlogin2.qq.com
+  # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to.
+  # All DNS questions are sent directly to the nameserver, without proxies
+  # involved. Clash answers the DNS question with the first result gathered.
+  nameserver:
+    - 114.114.114.114 # default value
+    - 1.1.1.1 # default value
+    - tls://1.1.1.1:853 # DNS over TLS
+    - https://1.1.1.1/dns-query # DNS over HTTPS
+#    - dhcp://en0 # dns from dhcp
+allow-lan: true
+mode: rule
+log-level: debug
+external-controller: 127.0.0.1:9090
+external-ui: "public"
+# secret: "clash-rs"
+experimental:
+  ignore-resolve-fail: true
+profile:
+  store-selected: true
+  store-fake-ip: false
+proxy-groups:
+  - name: "relay"
+    type: relay
+    proxies:
+      - "plain-vmess"
+      - "ws-vmess"
+      - "auto"
+      - "fallback-auto"
+      - "load-balance"
+      - "select"
+      - DIRECT
+  - name: "relay-one"
+    type: relay
+    use:
+      - "file-provider"
+  - name: "auto"
+    type: url-test
+    use:
+      - "file-provider"
+    proxies:
+      - DIRECT
+    url: "http://www.gstatic.com/generate_204"
+    interval: 300
+  - name: "fallback-auto"
+    type: fallback
+    use:
+      - "file-provider"
+    proxies:
+      - DIRECT
+    url: "http://www.gstatic.com/generate_204"
+    interval: 300
+  - name: "load-balance"
+    type: load-balance
+    use:
+      - "file-provider"
+    proxies:
+      - DIRECT
+    strategy: round-robin
+    url: "http://www.gstatic.com/generate_204"
+    interval: 300
+  - name: select
+    type: select
+    use:
+      - "file-provider"
+  - name: test 🌏
+    type: select
+    use:
+      - "file-provider"
+    proxies:
+      - DIRECT
+proxies:
+  - name: plain-vmess
+    type: vmess
+    server: 10.0.0.13
+    port: 16823
+    uuid: b831381d-6324-4d53-ad4f-8cda48b30811
+    alterId: 0
+    cipher: auto
+    udp: true
+    skip-cert-verify: true
+  - name: ws-vmess
+    type: vmess
+    server: 10.0.0.13
+    port: 16824
+    uuid: b831381d-6324-4d53-ad4f-8cda48b30811
+    alterId: 0
+    cipher: auto
+    udp: true
+    skip-cert-verify: true
+    network: ws
+    ws-opts:
+      path: /api/v3/download.getFile
+      headers:
+        Host: www.amazon.com
+  - name: tls-vmess
+    type: vmess
+    server: 10.0.0.13
+    port: 8443
+    uuid: 23ad6b10-8d1a-40f7-8ad0-e3e35cd38297
+    alterId: 0
+    cipher: auto
+    udp: true
+    skip-cert-verify: true
+    tls: true
+  - name: h2-vmess
+    type: vmess
+    server: 10.0.0.13
+    port: 8444
+    uuid: b831381d-6324-4d53-ad4f-8cda48b30811
+    alterId: 0
+    cipher: auto
+    udp: true
+    skip-cert-verify: true
+    tls: true
+    network: h2
+    h2-opts:
+      path: /ray
+  - name: vmess-altid
+    type: vmess
+    server: tw-1.ac.laowanxiang.com
+    port: 153
+    uuid: 46dd0dd3-2cc0-3f55-907c-d94e54877687
+    alterId: 64
+    cipher: auto
+    udp: true
+    network: ws
+    ws-opts:
+      path: /api/v3/download.getFile
+      headers:
+        Host: 5607b9d187e655736f563fee87d7283994721.laowanxiang.com
+  - name: "ss-simple"
+    type: ss
+    server: 10.0.0.13
+    port: 8388
+    cipher: aes-256-gcm
+    password: "password"
+    udp: true
+  - name: "trojan"
+    type: trojan
+    server: 10.0.0.13
+    port: 9443
+    password: password1
+    udp: true
+    # sni: example.com # aka server name
+    alpn:
+      - h2
+      - http/1.1
+    skip-cert-verify: true
+proxy-providers:
+  file-provider:
+    type: file
+    path: ./ss.yaml
+    interval: 300
+    health-check:
+      enable: true
+      url: http://www.gstatic.com/generate_204
+      interval: 300
+rule-providers:
+  file-provider:
+    type: file
+    path: ./rule-set.yaml
+    interval: 300
+    behavior: domain
+rules:
+  - DOMAIN,ipinfo.io,relay
+  - RULE-SET,file-provider,trojan
+  - GEOIP,CN,relay
+  - DOMAIN-SUFFIX,facebook.com,REJECT
+  - DOMAIN-KEYWORD,google,select
+  - DOMAIN,google.com,select
+  - SRC-IP-CIDR,192.168.1.1/24,DIRECT
+  - GEOIP,CN,DIRECT
+  - DST-PORT,53,trojan
+  - SRC-PORT,7777,DIRECT
+  - MATCH, DIRECT
+...
 

Fields§

§port: Option<u16>

The HTTP proxy port

§socks_port: Option<u16>

The SOCKS5 proxy port

§mixed_port: Option<u16>

The HTTP/SOCKS5 mixed proxy port

@@ -76,15 +280,15 @@

Note

Example

tun:
   enable: true
   device-id: "dev://utun1989"
-

Trait Implementations§

§

impl Default for Config

§

fn default() -> Config

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Configwhere - Config: Default,

§

fn deserialize<__D>( +

Trait Implementations§

§

impl Default for Config

§

fn default() -> Config

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Configwhere + Config: Default,

§

fn deserialize<__D>( __deserializer: __D -) -> Result<Config, <__D as Deserializer<'de>>::Error>where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl FromStr for Config

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Config, <Config as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Serialize for Config

§

fn serialize<__S>( +) -> Result<Config, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl FromStr for Config

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Config, <Config as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Serialize for Config

§

fn serialize<__S>( &self, __serializer: __S -) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for Twhere +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

@@ -96,12 +300,12 @@

Example

From<T>,
const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere - T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T, U> TryFrom<U> for Twhere +

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere + T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere - T: for<'de> Deserialize<'de>,

\ No newline at end of file +WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/docs/clash_doc/struct.ClashDNSConfigDef.html b/docs/clash_doc/struct.ClashDNSConfigDef.html index 91029dd50..a82c4ee53 100644 --- a/docs/clash_doc/struct.ClashDNSConfigDef.html +++ b/docs/clash_doc/struct.ClashDNSConfigDef.html @@ -34,15 +34,15 @@

Example

§fake_ip_filter: Vec<String, Global>

Fake IP addresses filter

§default_nameserver: Vec<String, Global>

Default nameservers, used to resolve DoH hostnames

§nameserver_policy: HashMap<String, String, RandomState>

Lookup domains via specific nameservers

-

Trait Implementations§

§

impl Default for DNS

§

fn default() -> DNS

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for DNSwhere - DNS: Default,

§

fn deserialize<__D>( +

Trait Implementations§

§

impl Default for DNS

§

fn default() -> DNS

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for DNSwhere + DNS: Default,

§

fn deserialize<__D>( __deserializer: __D -) -> Result<DNS, <__D as Deserializer<'de>>::Error>where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for DNS

§

fn serialize<__S>( +) -> Result<DNS, <__D as Deserializer<'de>>::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for DNS

§

fn serialize<__S>( &self, __serializer: __S -) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for DNS

§

impl Send for DNS

§

impl Sync for DNS

§

impl Unpin for DNS

§

impl UnwindSafe for DNS

Blanket Implementations§

source§

impl<T> Any for Twhere +) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for DNS

§

impl Send for DNS

§

impl Sync for DNS

§

impl Unpin for DNS

§

impl UnwindSafe for DNS

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

@@ -54,12 +54,12 @@

Example

From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere - T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T, U> TryFrom<U> for Twhere +

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere + T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere - T: for<'de> Deserialize<'de>,

\ No newline at end of file +WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 000000000..cf2bace0c --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,8 @@ +[ ! -d "target/artifacts" ] && mkdir target/artifacts + +for TARGET in $1; do + echo "building for $TARGET" + rustup target add $TARGET + cargo build -p clash --target $TARGET --release + mv ./target/$TARGET/release/clash ./target/artifacts/clash-$TARGET +done