小编Tec*_*dar的帖子

如何防止docker在系统启动时自动启动容器?

Docker在每个系统启动(debian)上启动一个容器,但我没有创建一个服务来执行此操作.我该如何防止码头工作?

startup docker

85
推荐指数
2
解决办法
4万
查看次数

如何等待一个盒装未来的结果?

use futures::{future, Future};

fn test() -> Box<dyn Future<Output = bool>> {
    Box::new(future::ok::<bool>(true))
}

async fn async_fn() -> bool {
    let result: bool = test().await;
    return result;
}

fn main(){
    async_fn();
    println!("Hello!");
}
Run Code Online (Sandbox Code Playgroud)

操场

错误:

use futures::{future, Future};

fn test() -> Box<dyn Future<Output = bool>> {
    Box::new(future::ok::<bool>(true))
}

async fn async_fn() -> bool {
    let result: bool = test().await;
    return result;
}

fn main(){
    async_fn();
    println!("Hello!");
}
Run Code Online (Sandbox Code Playgroud)

future rust async-await

12
推荐指数
2
解决办法
3781
查看次数

actix-web 处理程序中的 HTTP 请求 -&gt; 一次多个执行程序:EnterError

actix-web解析器中创建超级发布请求时,会引发以下错误 - 如何通过将请求生成到现有执行程序来发送 http 请求?

thread 'actix-rt:worker:1' panicked at 'Multiple executors at once: EnterError { reason: "attempted to run an executor while another executor is already running" }', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Panic in Arbiter thread, shutting down system.
Run Code Online (Sandbox Code Playgroud)

主文件

extern crate actix_web;
extern crate serde_json;
extern crate actix_rt;
extern crate hyper;

use serde_json::{Value, json};
use hyper::{Client, Uri, Body, Request};
use actix_web::{middleware, web, App, HttpResponse, HttpServer};
use actix_rt::System;
use actix_web::client;
use …
Run Code Online (Sandbox Code Playgroud)

rust hyper rust-tokio actix-web

5
推荐指数
1
解决办法
2240
查看次数

Kubernetes NodePort - Ufw/Iptables 被忽略?

我在一台机器上打开了一个 Kubernetes NodePort,并使用以下规则阻止了到该端口的所有流量:

sudo ufw deny 30001
Run Code Online (Sandbox Code Playgroud)

但我仍然可以通过浏览器访问该端口。常见吗?我在文档中找不到任何相关信息。

iptables kubernetes ufw kubernetes-ingress

1
推荐指数
1
解决办法
2278
查看次数

Rust 函数名称(调用者)或宏内的任何其他上下文

Rust 有没有办法获取“调用”函数名称或宏内的任何其他上下文信息?

例子:

#[macro_export]
macro_rules! somemacro {
    ( $x:expr ) => {
        {
          // access function name (etc..) that called this macro
        }
    };
}
Run Code Online (Sandbox Code Playgroud)

macros rust

0
推荐指数
1
解决办法
2984
查看次数