Page MenuHomeDevCentral

rust.py
No OneTemporary

# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Salt — Rust module
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Provide support for Rust properties
# License: BSD-2-Clause
# -------------------------------------------------------------
from salt.utils.path import which as path_which
def __virtual__():
"""
Only load if the Rust compiler is available
"""
return (
path_which("rustc") is not None,
"The Rust execution module cannot be loaded: rustc not installed.",
)
def get_rustc_triplet():
"""
A function to get a node triplet for Rust toolchains.
CLI Example:
salt * rust.get_rustc_triplet
"""
# Thanks to @semarie for that tip.
return __salt__["cmd.shell"]("rustc -vV | sed -ne 's/^host: //p'")

File Metadata

Mime Type
text/x-python
Expires
Thu, Dec 26, 02:14 (18 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260515
Default Alt Text
rust.py (907 B)

Event Timeline