i need construction:
SomeStruct::new()
#[if variable is Some(arg1)]
.func1(arg1)
#[else]
.func2(arg2)
if #[if] return true: add .func1() to SomeStruct::new() -> SomeStruct::new().func1(arg1)
if #[if] return false: add .func2() to SomeStruct::new() -> SomeStruct::new().func2(arg2)
Are you looking to do this conditional at runtime (i.e. change the flow of execution based on something's value) or compile time (change execution based on things when you compiled the code)?
For the former, you are probably looking for the Control Flow chapter from The Rust Programming Language (sometimes just called The Book).
The latter is more advanced and typically used to make things cross-platform (i.e. you may change a method based on whether it's Linux/Windows or x86-64/arm). The Forms of conditional compilation chapter from The Rust Reference does a pretty good job of explaining how it can be used.