pub struct QrCodeArgBuilder { /* private fields */ }Expand description
二维码参数构建器
提供链式调用的方式构建二维码参数,确保参数的正确性。
§示例
use wechat_minapp::qr::{QrCodeArgs, Rgb, MinappEnvVersion};
let args = QrCodeArgs::builder()
.path("pages/index/index")
.width(300)
.with_auto_color()
.line_color(Rgb::new(255, 0, 0))
.with_is_hyaline()
.env_version(MinappEnvVersion::Release)
.build()
.unwrap();Implementations§
Source§impl QrCodeArgBuilder
impl QrCodeArgBuilder
pub fn new() -> Self
pub fn path(self, path: impl Into<String>) -> Self
pub fn width(self, width: i16) -> Self
pub fn with_auto_color(self) -> Self
pub fn line_color(self, color: Rgb) -> Self
pub fn with_is_hyaline(self) -> Self
pub fn env_version(self, version: MinappEnvVersion) -> Self
pub fn build(self) -> Result<QrCodeArgs>
Trait Implementations§
Source§impl Debug for QrCodeArgBuilder
impl Debug for QrCodeArgBuilder
Source§impl Default for QrCodeArgBuilder
impl Default for QrCodeArgBuilder
Source§impl<'de> Deserialize<'de> for QrCodeArgBuilder
impl<'de> Deserialize<'de> for QrCodeArgBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QrCodeArgBuilder
impl RefUnwindSafe for QrCodeArgBuilder
impl Send for QrCodeArgBuilder
impl Sync for QrCodeArgBuilder
impl Unpin for QrCodeArgBuilder
impl UnsafeUnpin for QrCodeArgBuilder
impl UnwindSafe for QrCodeArgBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more