예제 #1
0
 static void ApplyDifference(OutputTarget target, OutputTarget diff)
 {
     target.Name    = SetString(target.Name, diff.Name);
     target.Path    = SetString(target.Path, diff.Path);
     target.Test    = SetBool(target.Test, diff.Test);
     target.Doctest = SetBool(target.Doctest, diff.Doctest);
     target.Bench   = SetBool(target.Bench, diff.Bench);
     target.Doc     = SetBool(target.Doc, diff.Doc);
     target.Plugin  = SetBool(target.Plugin, diff.Plugin);
     target.Harness = SetBool(target.Harness, diff.Harness);
 }
예제 #2
0
        public UIntPtr Set(OutputTarget target)
        {
            OutputTarget managedTarget = this.targets.Find(t => t.Handle == target.Handle);
            UIntPtr      newHandle     = target.WithRaw(raw => Rust.Call(SafeNativeMethods.set_output_target, this.manifest, raw));

            if (newHandle != UIntPtr.Zero)
            {
                managedTarget.Handle = newHandle;
            }
            ApplyDifference(managedTarget, target);
            return(newHandle);
        }
예제 #3
0
 public UIntPtr Add(OutputTarget target)
 {
     target.Handle = target.WithRaw(raw => Rust.Call(SafeNativeMethods.add_output_target, this.manifest, raw));
     this.targets.Add(target);
     return(target.Handle.Value);
 }