Args

Struct Args 

Source
pub(crate) struct Args {
Show 20 fields pub(crate) cfg_file: Option<String>, pub(crate) ip: Option<String>, pub(crate) port: Option<u16>, pub(crate) login_account: Option<String>, pub(crate) login_pwd: Option<String>, pub(crate) login_pwd_md5: Option<String>, pub(crate) login_region: Option<String>, pub(crate) auth_server: Option<String>, pub(crate) log_level: Option<String>, pub(crate) websocket_port: Option<u16>, pub(crate) telnet_port: Option<u16>, pub(crate) rest_port: Option<u16>, pub(crate) grpc_port: Option<u16>, pub(crate) rsa_private_key: Option<String>, pub(crate) json_log: bool, pub(crate) lang: Option<String>, pub(crate) rest_keys_file: Option<PathBuf>, pub(crate) grpc_keys_file: Option<PathBuf>, pub(crate) ws_keys_file: Option<PathBuf>, pub(crate) audit_log: Option<PathBuf>,
}
Expand description

FutuOpenD Rust Gateway — 完全替代 C++ OpenD

Fields§

§cfg_file: Option<String>

XML 配置文件路径 (兼容 C++ FutuOpenD.xml)

§ip: Option<String>

API 服务监听地址

§port: Option<u16>

API 服务监听端口

§login_account: Option<String>

登录账号

§login_pwd: Option<String>

登录密码明文

§login_pwd_md5: Option<String>

登录密码 MD5 (32 位小写 hex)

§login_region: Option<String>

后端连接区域 (gz/sh/hk)

§auth_server: Option<String>

认证服务器 URL

§log_level: Option<String>

日志级别

§websocket_port: Option<u16>

WebSocket 服务监听端口(可选,不指定则不启动 WebSocket)

§telnet_port: Option<u16>

Telnet 管理端口(可选,不指定则不启动 Telnet)

§rest_port: Option<u16>

REST API 监听端口(可选,不指定则不启动 REST API)

§grpc_port: Option<u16>

gRPC 服务监听端口(可选,不指定则不启动 gRPC)

§rsa_private_key: Option<String>

RSA 私钥文件路径(PEM 格式,启用后 InitConnect 使用 RSA 加解密)

§json_log: bool

JSON 格式日志

§lang: Option<String>

界面语言 (chs=简体中文, cht=繁体中文, en=英文)

§rest_keys_file: Option<PathBuf>

REST API Bearer Token 鉴权:加载 keys.json(futucli gen-key 生成)

不指定时 REST API 无鉴权(保持旧行为,启动 warn)。

§grpc_keys_file: Option<PathBuf>

gRPC Bearer Token 鉴权:加载 keys.json(futucli gen-key 生成)

不指定时 gRPC 无鉴权。通常与 –rest-keys-file 指向同一文件。

§ws_keys_file: Option<PathBuf>

核心 WebSocket Bearer Token 鉴权:加载 keys.json

v1.0 起核心 WS(--websocket-port,Futu SDK 使用的 binary WS)支持 握手 + per-message scope 鉴权。客户端用 ?token=<plaintext> query 或 Authorization: Bearer <plaintext> header 传 key。不指定这个 flag 时 WS 无鉴权(legacy 保持兼容,启动 warn)。通常与 --rest-keys-file 指向 同一文件。

§audit_log: Option<PathBuf>

审计日志输出:JSONL 文件路径或目录

  • 带扩展名的路径(如 /var/log/futu-audit.jsonl)→ 单文件 append
  • 不带扩展名 / 以 / 结尾(如 /var/log/futu-audit/)→ 每日滚动, 文件名 futu-audit.log + 日期后缀

只记录 auth / 交易 事件(target = “futu_audit”),常规日志不受影响。

Trait Implementations§

Source§

impl Args for Args

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl CommandFactory for Args

Source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
Source§

impl Debug for Args

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Args

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Args

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more